hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject hbase git commit: HBASE-12699 undefined method 'setAsyncLogFlush' exception thrown when setting DEFERRED_LOG_FLUSH=>true (Stephen Jiang)
Date Tue, 16 Dec 2014 21:24:11 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 049b640cc -> 71c0e5b9d


HBASE-12699 undefined method 'setAsyncLogFlush' exception thrown when setting DEFERRED_LOG_FLUSH=>true
(Stephen Jiang)


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

Branch: refs/heads/0.98
Commit: 71c0e5b9de244e0bb96ca4c5b010f981acbda1ee
Parents: 049b640
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue Dec 16 09:35:24 2014 -0800
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Tue Dec 16 13:11:40 2014 -0800

----------------------------------------------------------------------
 hbase-shell/src/main/ruby/hbase/admin.rb | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/71c0e5b9/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 5ca18a6..29e8651 100644
--- a/hbase-shell/src/main/ruby/hbase/admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/admin.rb
@@ -270,7 +270,15 @@ module Hbase
         htd.setReadOnly(JBoolean.valueOf(arg.delete(READONLY))) if arg[READONLY]
         htd.setCompactionEnabled(JBoolean.valueOf(arg[COMPACTION_ENABLED])) if arg[COMPACTION_ENABLED]
         htd.setMemStoreFlushSize(JLong.valueOf(arg.delete(MEMSTORE_FLUSHSIZE))) if arg[MEMSTORE_FLUSHSIZE]
-        htd.setAsyncLogFlush(JBoolean.valueOf(arg.delete(DEFERRED_LOG_FLUSH))) if arg[DEFERRED_LOG_FLUSH]
+        # DEFERRED_LOG_FLUSH is deprecated and was replaced by DURABILITY.  To keep backward
compatible, it still exists.
+        # However, it has to be set before DURABILITY so that DURABILITY could overwrite
if both args are set
+        if arg.include?(DEFERRED_LOG_FLUSH)
+          if arg.delete(DEFERRED_LOG_FLUSH).to_s.upcase == "TRUE"
+            htd.setDurability(org.apache.hadoop.hbase.client.Durability.valueOf("ASYNC_WAL"))
+          else
+            htd.setDurability(org.apache.hadoop.hbase.client.Durability.valueOf("SYNC_WAL"))
+          end
+        end
         htd.setDurability(org.apache.hadoop.hbase.client.Durability.valueOf(arg.delete(DURABILITY)))
if arg[DURABILITY]
         set_user_metadata(htd, arg.delete(METADATA)) if arg[METADATA]
         set_descriptor_config(htd, arg.delete(CONFIGURATION)) if arg[CONFIGURATION]
@@ -510,7 +518,15 @@ module Hbase
         htd.setReadOnly(JBoolean.valueOf(arg.delete(READONLY))) if arg[READONLY]
         htd.setCompactionEnabled(JBoolean.valueOf(arg[COMPACTION_ENABLED])) if arg[COMPACTION_ENABLED]
         htd.setMemStoreFlushSize(JLong.valueOf(arg.delete(MEMSTORE_FLUSHSIZE))) if arg[MEMSTORE_FLUSHSIZE]
-        htd.setAsyncLogFlush(JBoolean.valueOf(arg.delete(DEFERRED_LOG_FLUSH))) if arg[DEFERRED_LOG_FLUSH]
+        # DEFERRED_LOG_FLUSH is deprecated and was replaced by DURABILITY.  To keep backward
compatible, it still exists.
+        # However, it has to be set before DURABILITY so that DURABILITY could overwrite
if both args are set
+        if arg.include?(DEFERRED_LOG_FLUSH)
+          if arg.delete(DEFERRED_LOG_FLUSH).to_s.upcase == "TRUE"
+            htd.setDurability(org.apache.hadoop.hbase.client.Durability.valueOf("ASYNC_WAL"))
+          else
+            htd.setDurability(org.apache.hadoop.hbase.client.Durability.valueOf("SYNC_WAL"))
+          end
+        end
         htd.setDurability(org.apache.hadoop.hbase.client.Durability.valueOf(arg.delete(DURABILITY)))
if arg[DURABILITY]
         set_user_metadata(htd, arg.delete(METADATA)) if arg[METADATA]
         set_descriptor_config(htd, arg.delete(CONFIGURATION)) if arg[CONFIGURATION]


Mime
View raw message