Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-25602 Fix broken TestReplicationShell on master #2981

Merged
merged 1 commit into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions hbase-shell/src/main/ruby/hbase/replication_admin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ def set_peer_tableCFs(id, tableCFs)
end
rpc = get_peer_config(id)
unless rpc.nil?
rpc.setTableCFsMap(map)
@admin.updateReplicationPeerConfig(id, rpc)
builder = ReplicationPeerConfig.newBuilder(rpc)
builder.setTableCFsMap(map)
@admin.updateReplicationPeerConfig(id, builder.build)
end
end
end
Expand Down Expand Up @@ -251,8 +252,9 @@ def set_peer_namespaces(id, namespaces)
end
rpc = get_peer_config(id)
unless rpc.nil?
rpc.setNamespaces(ns_set)
@admin.updateReplicationPeerConfig(id, rpc)
builder = ReplicationPeerConfig.newBuilder(rpc)
builder.setNamespaces(ns_set)
@admin.updateReplicationPeerConfig(id, builder.build)
end
end
end
Expand Down Expand Up @@ -311,10 +313,9 @@ def show_peer_namespaces(peer_config)
# Set new bandwidth config for the specified peer
def set_peer_bandwidth(id, bandwidth)
rpc = get_peer_config(id)
unless rpc.nil?
rpc.setBandwidth(bandwidth)
@admin.updateReplicationPeerConfig(id, rpc)
end
return if rpc.nil?
rpc = ReplicationPeerConfig.newBuilder(rpc).setBandwidth(bandwidth).build
@admin.updateReplicationPeerConfig(id, rpc)
end

# Append exclude namespaces config for the specified peer
Expand Down Expand Up @@ -359,7 +360,7 @@ def remove_peer_exclude_namespaces(id, namespaces)
def set_peer_replicate_all(id, replicate_all)
rpc = get_peer_config(id)
return if rpc.nil?
rpc.setReplicateAllUserTables(replicate_all)
rpc = ReplicationPeerConfig.newBuilder(rpc).setReplicateAllUserTables(replicate_all).build
@admin.updateReplicationPeerConfig(id, rpc)
end

Expand All @@ -381,7 +382,7 @@ def set_peer_exclude_namespaces(id, exclude_namespaces)
end
rpc = get_peer_config(id)
return if rpc.nil?
rpc.setExcludeNamespaces(exclude_ns_set)
rpc = ReplicationPeerConfig.newBuilder(rpc).setExcludeNamespaces(exclude_ns_set).build
@admin.updateReplicationPeerConfig(id, rpc)
end

Expand All @@ -404,7 +405,7 @@ def set_peer_exclude_tableCFs(id, exclude_tableCFs)
end
rpc = get_peer_config(id)
return if rpc.nil?
rpc.setExcludeTableCFsMap(map)
rpc = ReplicationPeerConfig.newBuilder(rpc).setExcludeTableCFsMap(map).build
@admin.updateReplicationPeerConfig(id, rpc)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@
*/
package org.apache.hadoop.hbase.client;

import java.io.IOException;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.jruby.embed.PathType;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;

@Category({ ClientTests.class, LargeTests.class })
Expand Down