ankitjain64 commented on a change in pull request #2284:
URL: https://github.com/apache/hbase/pull/2284#discussion_r474346612



##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java
##########
@@ -450,6 +451,45 @@ public static ReplicationPeerConfig 
appendTableCFsToReplicationPeerConfig(
     return builder.build();
   }
 
+  /**
+   Sample Configuration
+   <property>
+   <name>hbase.replication.peer.default.configs</name>
+   
<value>hbase.replication.source.custom.walentryfilters=x,y,z;hbase.xxx.custom_property=123</value>
+   </property>
+   */
+
+  /**
+   * Helper method to add default peer configs from HBase Configuration to 
ReplicationPeerConfig
+   * @param conf Configuration
+   * @return true if new configurations was added.
+   */
+  public static ReplicationPeerConfig 
addDefaultPeerConfigsIfNotPresent(Configuration conf, ReplicationPeerConfig 
receivedPeerConfig){
+
+    ReplicationPeerConfigBuilder copiedPeerConfigBuilder = 
ReplicationPeerConfig.newBuilder(receivedPeerConfig);
+    String defaultPeerConfigs = 
conf.get(HBASE_REPLICATION_PEER_DEFAULT_CONFIG);
+
+    Map<String,String> peerConfigurations = 
receivedPeerConfig.getConfiguration();
+
+    if(defaultPeerConfigs != null && defaultPeerConfigs.length() != 0){
+      String[] defaultPeerConfigList = defaultPeerConfigs.split(";");

Review comment:
       >> so you could choose a delimiter that was outside of the constraint set
   Are there any current constraints regarding the convention on peer values 
that I can refer to?
   
   I looked around and since there can be multiple values of a particular peer 
config that are generally delimited by `,` so I decided to use `;` for 
delimiting different peer configs. But I am happy to change this if it can 
cause any problems in your opinion. Thanks




----------------------------------------------------------------
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:
[email protected]


Reply via email to