HBASE-24539: Fix the classpath for mini-cluster#4
Conversation
Fixes the classpath and HBaseTestingUtility c'tor invocation. Promoted some local JNI refs to global to avoid GC cleaning them up. Tested locally with a single unit-test that can bring-up the minicluster up cleanly. There are other minicluster lifecycle issues that need to be fixed (follow on patches) before we can fully use it.
|
@phrocker FYI |
phrocker
left a comment
There was a problem hiding this comment.
LGTM. I think I encountered some of those life cycle issues when playing around with this but since I saw your caveat makes sense for follow up. Thanks!
| } else { | ||
| clspath.assign(classpath, strlen(classpath)); | ||
| // Default classpath loaded from downloaded HBase src (paths defined in CMakeLists.txt) | ||
| string clspath_file_path("./apachehbase-src/hbase-build-configuration/target/cached_classpath.txt"); |
There was a problem hiding this comment.
In the case where they provide HBASE_HOME this might get a little tricky. Could have cmake pass HBASE_HOME as an option for compilation here so the path needn't be hardcoded in the future ( as a follow up ).
There was a problem hiding this comment.
It also takes CLASSPATH env variable (L37). If its set, everything from the classpath is passed over to java.classpath.
CLASSPATH="/path/to/cached_classpath.txt" ./test-binary also works if the users want to pass a custom HBASE_HOME based classpath.
bharathv
left a comment
There was a problem hiding this comment.
Thanks for the quick review.
| } else { | ||
| clspath.assign(classpath, strlen(classpath)); | ||
| // Default classpath loaded from downloaded HBase src (paths defined in CMakeLists.txt) | ||
| string clspath_file_path("./apachehbase-src/hbase-build-configuration/target/cached_classpath.txt"); |
There was a problem hiding this comment.
It also takes CLASSPATH env variable (L37). If its set, everything from the classpath is passed over to java.classpath.
CLASSPATH="/path/to/cached_classpath.txt" ./test-binary also works if the users want to pass a custom HBASE_HOME based classpath.
Plan to redo the lifecycle as a part of https://issues.apache.org/jira/browse/HBASE-24538 |
Fixes the classpath and HBaseTestingUtility c'tor invocation.
Promoted some local JNI refs to global to avoid GC cleaning them up.
Tested locally with a single unit-test that can bring-up the minicluster
up cleanly. There are other minicluster lifecycle issues that need to
be fixed (follow on patches) before we can fully use it.