sharmaar12 commented on code in PR #7857:
URL: https://github.com/apache/hbase/pull/7857#discussion_r2923496549
##########
hbase-client/src/main/java/org/apache/hadoop/hbase/ActiveClusterSuffix.java:
##########
@@ -31,18 +34,40 @@
*/
@InterfaceAudience.Private
public class ActiveClusterSuffix {
- private final String active_cluster_suffix;
+ private final String cluster_id;
+ private final String suffix;
/**
* New ActiveClusterSuffix.
*/
- public ActiveClusterSuffix(final String cs) {
- this.active_cluster_suffix = cs;
+ public ActiveClusterSuffix(final String cs, final String suffix) {
+ this.cluster_id = cs;
+ this.suffix = suffix;
}
- public String getActiveClusterSuffix() {
- return active_cluster_suffix;
+ public ActiveClusterSuffix(final String input) {
+ String[] parts = input.split(":");
+ this.cluster_id = parts[0];
+ if (parts.length > 1) {
+ this.suffix = parts[1];
+ } else {
+ this.suffix = "";
+ }
+ }
+
+ public static ActiveClusterSuffix fromConfig(Configuration conf, ClusterId
clusterId) {
+ return new ActiveClusterSuffix(clusterId.toString(),
conf.get(HConstants.HBASE_META_TABLE_SUFFIX,
+ HConstants.HBASE_META_TABLE_SUFFIX_DEFAULT_VALUE));
Review Comment:
getSuffixFromConfig() will give you full string containing
<clusterID>:<Suffix> but here we just want <suffix> hence we can't change this
way.
Also getSuffixFromConfig has been removed post Andor's changes.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]