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 2020/12/14 20:53:47 UTC
[GitHub] [hbase] sandeepvinayak commented on a change in pull request #2778: HBASE-25383: Ability to update and remove peer base config
sandeepvinayak commented on a change in pull request #2778:
URL: https://github.com/apache/hbase/pull/2778#discussion_r542772730
##########
File path: hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java
##########
@@ -455,36 +458,45 @@ public static ReplicationPeerConfig appendTableCFsToReplicationPeerConfig(
/**
* Helper method to add base peer configs from Configuration to ReplicationPeerConfig
- * if not present in latter.
*
* This merges the user supplied peer configuration
* {@link org.apache.hadoop.hbase.replication.ReplicationPeerConfig} with peer configs
* provided as property hbase.replication.peer.base.configs in hbase configuration.
- * Expected format for this hbase configuration is "k1=v1;k2=v2,v2_1". Original value
- * of conf is retained if already present in ReplicationPeerConfig.
+ * Expected format for this hbase configuration is "k1=v1;k2=v2,v2_1".
*
* @param conf Configuration
* @return ReplicationPeerConfig containing updated configs.
*/
- public static ReplicationPeerConfig addBasePeerConfigsIfNotPresent(Configuration conf,
+ public static ReplicationPeerConfig updateReplicationBasePeerConfigs(Configuration conf,
ReplicationPeerConfig receivedPeerConfig) {
- String basePeerConfigs = conf.get(HBASE_REPLICATION_PEER_BASE_CONFIG, "");
+ String removeBasePeerConfigs = conf.get(HBASE_REPLICATION_PEER_REMOVE_BASE_CONFIG, "");
ReplicationPeerConfigBuilder copiedPeerConfigBuilder = ReplicationPeerConfig.
newBuilder(receivedPeerConfig);
- Map<String,String> receivedPeerConfigMap = receivedPeerConfig.getConfiguration();
+ // remove the peer configurations specified in the conf
+ if (removeBasePeerConfigs.length() != 0) {
+ List<String> removeBasePeerConfigList = Splitter.on(';').trimResults()
+ .omitEmptyStrings().splitToList(removeBasePeerConfigs);
+ for (String peerConfigToRemove : removeBasePeerConfigList) {
+ copiedPeerConfigBuilder.removeConfiguration(peerConfigToRemove);
+ }
+ }
+
+ Map<String, String> receivedPeerConfigMap = receivedPeerConfig.getConfiguration();
+ String basePeerConfigs = conf.get(HBASE_REPLICATION_PEER_BASE_CONFIG, "");
Review comment:
@gjacoby126 That is correct. I will add a log here.
----------------------------------------------------------------
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