You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2010/12/07 20:42:51 UTC

svn commit: r1043178 - in /hbase/branches/0.90: CHANGES.txt src/main/ruby/hbase/admin.rb

Author: stack
Date: Tue Dec  7 19:42:51 2010
New Revision: 1043178

URL: http://svn.apache.org/viewvc?rev=1043178&view=rev
Log:
HBASE-3173 HBase 2984 breaks ability to specify BLOOMFILTER & COMPRESSION via shell

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/ruby/hbase/admin.rb

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1043178&r1=1043177&r2=1043178&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Tue Dec  7 19:42:51 2010
@@ -730,6 +730,8 @@ Release 0.90.0 - Unreleased
    HBASE-3314  [shell] 'move' is broken
    HBASE-3315  Add debug output for when balancer makes bad balance
    HBASE-3278  AssertionError in LoadBalancer
+   HBASE-3173  HBase 2984 breaks ability to specify BLOOMFILTER & COMPRESSION
+               via shell
 
 
   IMPROVEMENTS

Modified: hbase/branches/0.90/src/main/ruby/hbase/admin.rb
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/ruby/hbase/admin.rb?rev=1043178&r1=1043177&r2=1043178&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/ruby/hbase/admin.rb (original)
+++ hbase/branches/0.90/src/main/ruby/hbase/admin.rb Tue Dec  7 19:42:51 2010
@@ -28,6 +28,7 @@ java_import org.apache.hadoop.hbase.HReg
 java_import org.apache.hadoop.hbase.util.Bytes
 java_import org.apache.zookeeper.ZooKeeper
 java_import org.apache.hadoop.hbase.io.hfile.Compression
+java_import org.apache.hadoop.hbase.regionserver.StoreFile
 
 # Wrapper for org.apache.hadoop.hbase.client.HBaseAdmin
 
@@ -353,13 +354,19 @@ module Hbase
       family ||= HColumnDescriptor.new(name.to_java_bytes)
 
       family.setBlockCacheEnabled(JBoolean.valueOf(arg[HColumnDescriptor::BLOCKCACHE])) if arg.include?(HColumnDescriptor::BLOCKCACHE)
-      family.setBloomFilterType(arg[HColumnDescriptor::BLOOMFILTER]) if arg.include?(HColumnDescriptor::BLOOMFILTER)
       family.setScope(JInteger.valueOf(arg[REPLICATION_SCOPE])) if arg.include?(HColumnDescriptor::REPLICATION_SCOPE)
       family.setInMemory(JBoolean.valueOf(arg[IN_MEMORY])) if arg.include?(HColumnDescriptor::IN_MEMORY)
       family.setTimeToLive(JInteger.valueOf(arg[HColumnDescriptor::TTL])) if arg.include?(HColumnDescriptor::TTL)
       family.setBlocksize(JInteger.valueOf(arg[HColumnDescriptor::BLOCKSIZE])) if arg.include?(HColumnDescriptor::BLOCKSIZE)
       family.setMaxVersions(JInteger.valueOf(arg[VERSIONS])) if arg.include?(HColumnDescriptor::VERSIONS)
-
+      if arg.include?(HColumnDescriptor::BLOOMFILTER)
+        bloomtype = arg[HColumnDescriptor::BLOOMFILTER].upcase
+        unless StoreFile::BloomType.constants.include?(bloomtype)      
+          raise(ArgumentError, "BloomFilter type #{bloomtype} is not supported. Use one of " + StoreFile::BloomType.constants.join(" ")) 
+        else 
+          family.setBloomFilterType(StoreFile::BloomType.valueOf(bloomtype))
+        end
+      end
       if arg.include?(HColumnDescriptor::COMPRESSION)
         compression = arg[HColumnDescriptor::COMPRESSION].upcase
         unless Compression::Algorithm.constants.include?(compression)