You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/01/22 15:02:15 UTC

[GitHub] [hbase] virajjasani commented on a change in pull request #2898: HBASE-25522 Remove deprecated methods in ReplicationPeerConfig

virajjasani commented on a change in pull request #2898:
URL: https://github.com/apache/hbase/pull/2898#discussion_r562690149



##########
File path: hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncReplicationAdminApi.java
##########
@@ -369,18 +365,17 @@ public void testSetPeerNamespaces() throws Exception {
     String ns1 = "ns1";
     String ns2 = "ns2";
 
-    ReplicationPeerConfig rpc = new ReplicationPeerConfig();
-    rpc.setClusterKey(KEY_ONE);
+    ReplicationPeerConfig rpc = ReplicationPeerConfig.newBuilder().setClusterKey(KEY_ONE).build();
     admin.addReplicationPeer(ID_ONE, rpc).join();
-    rpc.setReplicateAllUserTables(false);
+    rpc = ReplicationPeerConfig.newBuilder(rpc).setReplicateAllUserTables(false).build();

Review comment:
       Rather than creating a new builder from `rpc`, we can reuse old one.
   e.g
   ```
   ReplicationPeerConfigBuilder rpcBuilder = ReplicationPeerConfig.newBuilder().setClusterKey(KEY_ONE);
   admin.addReplicationPeer(ID_ONE, rpcBuilder.build()).join();
   rpcBuilder.setReplicateAllUserTables(false);
   admin.updateReplicationPeerConfig(ID_ONE, rpcBuilder.build()).join();
   ```
   
   Applicable to other similar places.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org