You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2017/12/22 13:45:10 UTC

[12/26] hbase git commit: HBASE-19591 Cleanup the usage of ReplicationAdmin from hbase-shell

HBASE-19591 Cleanup the usage of ReplicationAdmin from hbase-shell


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

Branch: refs/heads/HBASE-19397
Commit: 7501e644267e063601578b293757415ac04360e1
Parents: 001bce5
Author: Guanghao Zhang <zg...@apache.org>
Authored: Fri Dec 22 14:14:10 2017 +0800
Committer: Guanghao Zhang <zg...@apache.org>
Committed: Fri Dec 22 18:32:49 2017 +0800

----------------------------------------------------------------------
 hbase-shell/src/main/ruby/hbase/replication_admin.rb | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/7501e644/hbase-shell/src/main/ruby/hbase/replication_admin.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/hbase/replication_admin.rb b/hbase-shell/src/main/ruby/hbase/replication_admin.rb
index 949bf68..f80c547 100644
--- a/hbase-shell/src/main/ruby/hbase/replication_admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/replication_admin.rb
@@ -19,21 +19,19 @@
 
 include Java
 
-java_import org.apache.hadoop.hbase.client.replication.ReplicationAdmin
 java_import org.apache.hadoop.hbase.client.replication.ReplicationPeerConfigUtil
 java_import org.apache.hadoop.hbase.replication.ReplicationPeerConfig
 java_import org.apache.hadoop.hbase.util.Bytes
 java_import org.apache.hadoop.hbase.zookeeper.ZKConfig
 java_import org.apache.hadoop.hbase.TableName
 
-# Wrapper for org.apache.hadoop.hbase.client.replication.ReplicationAdmin
+# Used for replication administrative operations.
 
 module Hbase
   class RepAdmin
     include HBaseConstants
 
     def initialize(configuration)
-      @replication_admin = ReplicationAdmin.new(configuration)
       @configuration = configuration
       @admin = ConnectionFactory.createConnection(configuration).getAdmin
     end
@@ -272,10 +270,10 @@ module Hbase
     end
 
     def set_peer_replicate_all(id, replicate_all)
-      rpc = @replication_admin.getPeerConfig(id)
+      rpc = get_peer_config(id)
       return if rpc.nil?
       rpc.setReplicateAllUserTables(replicate_all)
-      @replication_admin.updatePeerConfig(id, rpc)
+      @admin.updateReplicationPeerConfig(id, rpc)
     end
 
     # Set exclude namespaces config for the specified peer