From 7ff1feeb8563c92dbd2f29dcd0fc9bfc8f1d7d88 Mon Sep 17 00:00:00 2001 From: Guanghao Zhang Date: Fri, 22 Dec 2017 14:14:10 +0800 Subject: [PATCH] HBASE-19591 Cleanup the usage of ReplicationAdmin from hbase-shell --- hbase-shell/src/main/ruby/hbase/replication_admin.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hbase-shell/src/main/ruby/hbase/replication_admin.rb b/hbase-shell/src/main/ruby/hbase/replication_admin.rb index 949bf6820ba..f80c547ef50 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