hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-18149 The setting rules for table-scope attributes and family-scope attributes should keep consistent
Date Wed, 07 Jun 2017 15:30:11 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-2 347bef8d3 -> 3d721798c


HBASE-18149 The setting rules for table-scope attributes and family-scope attributes should
keep consistent

Signed-off-by: tedyu <yuzhihong@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3d721798
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3d721798
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3d721798

Branch: refs/heads/branch-2
Commit: 3d721798c4a02b171d5395de59e3a449ed116177
Parents: 347bef8
Author: Guangxu Cheng <guangxucheng@gmail.com>
Authored: Fri Jun 2 11:37:41 2017 +0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Wed Jun 7 08:30:03 2017 -0700

----------------------------------------------------------------------
 hbase-shell/src/main/ruby/hbase/admin.rb      | 25 +++++++++++-----------
 hbase-shell/src/test/ruby/hbase/admin_test.rb |  8 +++++++
 2 files changed, 20 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/3d721798/hbase-shell/src/main/ruby/hbase/admin.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb
index 9739a13..634ad3b 100644
--- a/hbase-shell/src/main/ruby/hbase/admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/admin.rb
@@ -1220,19 +1220,18 @@ module Hbase
 
     # Parse arguments and update HTableDescriptor accordingly
     def update_htd_from_arg(htd, arg)
-      htd.setOwnerString(arg.delete(OWNER)) if arg[OWNER]
-      htd.setMaxFileSize(JLong.valueOf(arg.delete(MAX_FILESIZE))) if arg[MAX_FILESIZE]
-      htd.setReadOnly(JBoolean.valueOf(arg.delete(READONLY))) if arg[READONLY]
-      htd.setCompactionEnabled(JBoolean.valueOf(arg.delete(COMPACTION_ENABLED))) if arg[COMPACTION_ENABLED]
-      htd.setNormalizationEnabled(
-        JBoolean.valueOf(arg.delete(NORMALIZATION_ENABLED))) if arg[NORMALIZATION_ENABLED]
-      htd.setMemStoreFlushSize(JLong.valueOf(arg.delete(MEMSTORE_FLUSHSIZE))) if arg[MEMSTORE_FLUSHSIZE]
-      htd.setDurability(org.apache.hadoop.hbase.client.Durability.valueOf(arg.delete(DURABILITY)))
if arg[DURABILITY]
-      htd.setPriority(JInteger.valueOf(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::PRIORITY)))
if arg[org.apache.hadoop.hbase.HTableDescriptor::PRIORITY]
-      htd.setFlushPolicyClassName(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::FLUSH_POLICY))
if arg[org.apache.hadoop.hbase.HTableDescriptor::FLUSH_POLICY]
-      htd.setRegionMemstoreReplication(JBoolean.valueOf(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::REGION_MEMSTORE_REPLICATION)))
if arg[org.apache.hadoop.hbase.HTableDescriptor::REGION_MEMSTORE_REPLICATION]
-      htd.setRegionSplitPolicyClassName(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::SPLIT_POLICY))
if arg[org.apache.hadoop.hbase.HTableDescriptor::SPLIT_POLICY]
-      htd.setRegionReplication(JInteger.valueOf(arg.delete(REGION_REPLICATION))) if arg[REGION_REPLICATION]
+      htd.setOwnerString(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::OWNER)) if
arg.include?(org.apache.hadoop.hbase.HTableDescriptor::OWNER)
+      htd.setMaxFileSize(JLong.valueOf(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::MAX_FILESIZE)))
if arg.include?(org.apache.hadoop.hbase.HTableDescriptor::MAX_FILESIZE)
+      htd.setReadOnly(JBoolean.valueOf(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::READONLY)))
if arg.include?(org.apache.hadoop.hbase.HTableDescriptor::READONLY)
+      htd.setCompactionEnabled(JBoolean.valueOf(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::COMPACTION_ENABLED)))
if arg.include?(org.apache.hadoop.hbase.HTableDescriptor::COMPACTION_ENABLED)
+      htd.setNormalizationEnabled(JBoolean.valueOf(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::NORMALIZATION_ENABLED)))
if arg.include?(org.apache.hadoop.hbase.HTableDescriptor::NORMALIZATION_ENABLED)
+      htd.setMemStoreFlushSize(JLong.valueOf(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::MEMSTORE_FLUSHSIZE)))
if arg.include?(org.apache.hadoop.hbase.HTableDescriptor::MEMSTORE_FLUSHSIZE)
+      htd.setDurability(org.apache.hadoop.hbase.client.Durability.valueOf(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::DURABILITY)))
if arg.include?(org.apache.hadoop.hbase.HTableDescriptor::DURABILITY)
+      htd.setPriority(JInteger.valueOf(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::PRIORITY)))
if arg.include?(org.apache.hadoop.hbase.HTableDescriptor::PRIORITY)
+      htd.setFlushPolicyClassName(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::FLUSH_POLICY))
if arg.include?(org.apache.hadoop.hbase.HTableDescriptor::FLUSH_POLICY)
+      htd.setRegionMemstoreReplication(JBoolean.valueOf(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::REGION_MEMSTORE_REPLICATION)))
if arg.include?(org.apache.hadoop.hbase.HTableDescriptor::REGION_MEMSTORE_REPLICATION)
+      htd.setRegionSplitPolicyClassName(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::SPLIT_POLICY))
if arg.include?(org.apache.hadoop.hbase.HTableDescriptor::SPLIT_POLICY)
+      htd.setRegionReplication(JInteger.valueOf(arg.delete(org.apache.hadoop.hbase.HTableDescriptor::REGION_REPLICATION)))
if arg.include?(org.apache.hadoop.hbase.HTableDescriptor::REGION_REPLICATION)
       set_user_metadata(htd, arg.delete(METADATA)) if arg[METADATA]
       set_descriptor_config(htd, arg.delete(CONFIGURATION)) if arg[CONFIGURATION]
     end

http://git-wip-us.apache.org/repos/asf/hbase/blob/3d721798/hbase-shell/src/test/ruby/hbase/admin_test.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/test/ruby/hbase/admin_test.rb b/hbase-shell/src/test/ruby/hbase/admin_test.rb
index e42acde..29ab37a 100644
--- a/hbase-shell/src/test/ruby/hbase/admin_test.rb
+++ b/hbase-shell/src/test/ruby/hbase/admin_test.rb
@@ -245,6 +245,14 @@ module Hbase
       assert_equal(['a:', 'b:'], table(@create_test_name).get_all_columns.sort)
     end
 
+    define_test "create should work when attributes value 'false' is not enclosed in single
quotation marks" do
+      drop_test_table(@create_test_name)
+      command(:create, @create_test_name,{NAME => 'a', BLOCKCACHE => false}, {COMPACTION_ENABLED
=> false})
+      assert_equal(['a:'], table(@create_test_name).get_all_columns.sort)
+      assert_match(/BLOCKCACHE/, admin.describe(@create_test_name))
+      assert_match(/COMPACTION_ENABLED/, admin.describe(@create_test_name))
+    end
+
     #-------------------------------------------------------------------------------
 
     define_test "describe should fail for non-existent tables" do


Mime
View raw message