Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

junegunn
Copy link
Contributor

@junegunn junegunn commented Jun 5, 2025

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@junegunn junegunn marked this pull request as draft June 6, 2025 08:20
Comment on lines 239 to 243
@Override
public Optional<Integer> getActiveZooKeeperClientPort() {
return Optional.ofNullable(util.getZkCluster()).map(MiniZooKeeperCluster::getClientPort)
.filter(port -> port > 0);
}
Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@junegunn
Copy link
Contributor Author

junegunn commented Jun 6, 2025

Please take a look at the updated methods in 86ca728.

  • Null-safety
  • Support for HTTPS addresses

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")}")
hbase.zookeeper.quorum: localhost:2181
hbase.masters: 192.168.35.49:61959,192.168.35.49:61962
Active HBase Master: https://192.168.35.49:61964
Active HDFS NameNode: http://localhost:61940

It's quite different from what I originally proposed. If you like it, I'll update the Jira description accordingly.

@junegunn junegunn requested review from Apache9 and NihalJain June 6, 2025 14:28
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 30s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 3m 5s master passed
+1 💚 compile 0m 16s master passed
+1 💚 javadoc 0m 12s master passed
+1 💚 shadedjars 5m 55s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 1s the patch passed
+1 💚 compile 0m 18s the patch passed
+1 💚 javac 0m 18s the patch passed
+1 💚 javadoc 0m 13s the patch passed
+1 💚 shadedjars 6m 1s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 2m 6s hbase-testing-util in the patch passed.
22m 41s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7074/2/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7074
Optional Tests javac javadoc unit compile shadedjars
uname Linux 4f9e0fdb6e89 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 86ca728
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7074/2/testReport/
Max. process+thread count 2204 (vs. ulimit of 30000)
modules C: hbase-testing-util U: hbase-testing-util
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7074/2/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 31s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ master Compile Tests _
+1 💚 mvninstall 3m 24s master passed
+1 💚 compile 0m 25s master passed
+1 💚 checkstyle 0m 9s master passed
+1 💚 spotbugs 0m 29s master passed
+1 💚 spotless 0m 50s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 5s the patch passed
+1 💚 compile 0m 22s the patch passed
+1 💚 javac 0m 22s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 9s the patch passed
+1 💚 spotbugs 0m 33s the patch passed
+1 💚 hadoopcheck 12m 6s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 spotless 0m 45s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 9s The patch does not generate ASF License warnings.
30m 43s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7074/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7074
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux 363c59d370dc 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 86ca728
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 83 (vs. ulimit of 30000)
modules C: hbase-testing-util U: hbase-testing-util
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7074/2/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@junegunn junegunn marked this pull request as ready for review June 6, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants