hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1356518 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java
Date Mon, 02 Jul 2012 23:27:46 GMT
Author: apurtell
Date: Mon Jul  2 23:27:46 2012
New Revision: 1356518

URL: http://svn.apache.org/viewvc?rev=1356518&view=rev
Log:
HBASE-6303. HCD.setCompressionType should use Enum support for storing compression types as
strings

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java?rev=1356518&r1=1356517&r2=1356518&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java Mon Jul
 2 23:27:46 2012
@@ -567,14 +567,7 @@ public class HColumnDescriptor implement
    * @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 */



Mime
View raw message