-
Notifications
You must be signed in to change notification settings - Fork 3.3k
HBASE-29378 Make TestingHBaseCluster expose address/port information #7074
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
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/testing/TestingHBaseClusterImpl.java
Outdated
Show resolved
Hide resolved
hbase-testing-util/src/main/java/org/apache/hadoop/hbase/testing/TestingHBaseClusterImpl.java
Outdated
Show resolved
Hide resolved
@Override | ||
public Optional<Integer> getActiveZooKeeperClientPort() { | ||
return Optional.ofNullable(util.getZkCluster()).map(MiniZooKeeperCluster::getClientPort) | ||
.filter(port -> port > 0); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I have a second thought here as well.
Since the port is going to be used to build hbase.zookeeper.quorum
, we should probably return the ports of all servers, not just the leader's.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just return the zookeeper connect string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you're saying one can directly use the return value as hbase.zookeeper.quorum
? (e.g. localhost:1111,localhost:2222,localhost:3333
). If that's the case, I agree. I don't see much value in returning the ports separately and forcing the user to assemble the configuration string themselves.
Please take a look at the updated methods in 86ca728.
With the updated method signatures, it's going to be easier for users to print the information they need. println("hbase.zookeeper.quorum: ${cluster.zooKeeperQuorum.orElse("N/A")}")
println("hbase.masters: ${cluster.masterAddresses.joinToString(",")}")
println("Active HBase Master: ${cluster.activeMasterInfoAddress.orElse("N/A")}")
println("Active HDFS NameNode: ${cluster.activeNameNodeInfoAddress.orElse("N/A")}")
It's quite different from what I originally proposed. If you like it, I'll update the Jira description accordingly. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
https://issues.apache.org/jira/browse/HBASE-29378