HBASE-6303. HCD.setCompressionType should use Enum support for storing compression types as strings

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1356517 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Kyle Purtell 2012-07-02 23:27:34 +00:00
parent 2ec4c4b939
commit 5eacb5a6cf
1 changed files with 1 additions and 8 deletions

View File

@ -595,14 +595,7 @@ public class HColumnDescriptor implements WritableComparable<HColumnDescriptor>
* @return this (for chained invocation) * @return this (for chained invocation)
*/ */
public HColumnDescriptor setCompressionType(Compression.Algorithm type) { public HColumnDescriptor setCompressionType(Compression.Algorithm type) {
String compressionType; return setValue(COMPRESSION, type.getName().toUpperCase());
switch (type) {
case LZO: compressionType = "LZO"; break;
case GZ: compressionType = "GZ"; break;
case SNAPPY: compressionType = "SNAPPY"; break;
default: compressionType = "NONE"; break;
}
return setValue(COMPRESSION, compressionType);
} }
/** @return data block encoding algorithm used on disk */ /** @return data block encoding algorithm used on disk */