HBASE-25602 Fix broken TestReplicationShell on master (#2981)

Signed-off-by: Peter Somogyi <psomogyi@apache.org>
This commit is contained in:
Duo Zhang 2021-02-25 08:39:34 +08:00 committed by GitHub
parent 51a3d45f9d
commit ed2693f123
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 14 deletions

View File

@ -178,8 +178,9 @@ module Hbase
end end
rpc = get_peer_config(id) rpc = get_peer_config(id)
unless rpc.nil? unless rpc.nil?
rpc.setTableCFsMap(map) builder = ReplicationPeerConfig.newBuilder(rpc)
@admin.updateReplicationPeerConfig(id, rpc) builder.setTableCFsMap(map)
@admin.updateReplicationPeerConfig(id, builder.build)
end end
end end
end end
@ -251,8 +252,9 @@ module Hbase
end end
rpc = get_peer_config(id) rpc = get_peer_config(id)
unless rpc.nil? unless rpc.nil?
rpc.setNamespaces(ns_set) builder = ReplicationPeerConfig.newBuilder(rpc)
@admin.updateReplicationPeerConfig(id, rpc) builder.setNamespaces(ns_set)
@admin.updateReplicationPeerConfig(id, builder.build)
end end
end end
end end
@ -311,11 +313,10 @@ module Hbase
# Set new bandwidth config for the specified peer # Set new bandwidth config for the specified peer
def set_peer_bandwidth(id, bandwidth) def set_peer_bandwidth(id, bandwidth)
rpc = get_peer_config(id) rpc = get_peer_config(id)
unless rpc.nil? return if rpc.nil?
rpc.setBandwidth(bandwidth) rpc = ReplicationPeerConfig.newBuilder(rpc).setBandwidth(bandwidth).build
@admin.updateReplicationPeerConfig(id, rpc) @admin.updateReplicationPeerConfig(id, rpc)
end end
end
# Append exclude namespaces config for the specified peer # Append exclude namespaces config for the specified peer
def append_peer_exclude_namespaces(id, namespaces) def append_peer_exclude_namespaces(id, namespaces)
@ -359,7 +360,7 @@ module Hbase
def set_peer_replicate_all(id, replicate_all) def set_peer_replicate_all(id, replicate_all)
rpc = get_peer_config(id) rpc = get_peer_config(id)
return if rpc.nil? return if rpc.nil?
rpc.setReplicateAllUserTables(replicate_all) rpc = ReplicationPeerConfig.newBuilder(rpc).setReplicateAllUserTables(replicate_all).build
@admin.updateReplicationPeerConfig(id, rpc) @admin.updateReplicationPeerConfig(id, rpc)
end end
@ -381,7 +382,7 @@ module Hbase
end end
rpc = get_peer_config(id) rpc = get_peer_config(id)
return if rpc.nil? return if rpc.nil?
rpc.setExcludeNamespaces(exclude_ns_set) rpc = ReplicationPeerConfig.newBuilder(rpc).setExcludeNamespaces(exclude_ns_set).build
@admin.updateReplicationPeerConfig(id, rpc) @admin.updateReplicationPeerConfig(id, rpc)
end end
@ -404,7 +405,7 @@ module Hbase
end end
rpc = get_peer_config(id) rpc = get_peer_config(id)
return if rpc.nil? return if rpc.nil?
rpc.setExcludeTableCFsMap(map) rpc = ReplicationPeerConfig.newBuilder(rpc).setExcludeTableCFsMap(map).build
@admin.updateReplicationPeerConfig(id, rpc) @admin.updateReplicationPeerConfig(id, rpc)
end end

View File

@ -17,13 +17,10 @@
*/ */
package org.apache.hadoop.hbase.client; package org.apache.hadoop.hbase.client;
import java.io.IOException;
import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.LargeTests; import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.jruby.embed.PathType;
import org.junit.ClassRule; import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category; import org.junit.experimental.categories.Category;
@Category({ ClientTests.class, LargeTests.class }) @Category({ ClientTests.class, LargeTests.class })