forked from apache/kudu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
java: KuduBinaryExtractor should use the thread context classloader
Using the thread context classloader makes it straightforward to write end-to-end tests, one of which is included in this patch. This patch makes the following changes: 1. The KuduBinaryExtractor will now search for the test binary jars via the thread context classloader, if available. 2. Remove the work-in-progress OS-detection implementation from KuduBinaryExtractor (to be replaced in a future commit) because it was failing tests. 3. KuduBinaryExtractor will no longer cache its search results to make it more straightforward to use a thread local context classloader. 4. KuduBinaryExtractor.extractKuduBinary() now throws FileNotFoundException instead of IllegalStateException when the Kudu binary test jar cannot be found. Since it is a checked exception and a subclass of IOException it will be less likely to go uncaught. 5. Update the API docs to be more specific about the semantics of the public methods of KuduBinaryExtractor, including the use of the thread context classloader. 6. Add a simple test binary locator test using a child classloader plumbed into the KuduBinaryExtractor code by setting it as the thread context classloader. Change-Id: I5e1cf188bb557eeaea0b2867243855f3f2d121f1 Reviewed-on: http://gerrit.cloudera.org:8080/12147 Tested-by: Mike Percy <[email protected]> Reviewed-by: Brian McDevitt <[email protected]> Reviewed-by: Grant Henke <[email protected]>
- Loading branch information
Showing
2 changed files
with
60 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters