From 5eacb5a6cf4c92c89b8cf8a9939ea2010d99bd5d Mon Sep 17 00:00:00 2001 From: Andrew Kyle Purtell Date: Mon, 2 Jul 2012 23:27:34 +0000 Subject: [PATCH] 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 --- .../java/org/apache/hadoop/hbase/HColumnDescriptor.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java index e46d64f9268..1393e74c667 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java @@ -595,14 +595,7 @@ public class HColumnDescriptor implements WritableComparable * @return this (for chained invocation) */ public HColumnDescriptor setCompressionType(Compression.Algorithm type) { - String compressionType; - 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 setValue(COMPRESSION, type.getName().toUpperCase()); } /** @return data block encoding algorithm used on disk */