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:
parent
2ec4c4b939
commit
5eacb5a6cf
|
@ -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 */
|
||||||
|
|
Loading…
Reference in New Issue