Mike Percy has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/12147


Change subject: java: KuduBinaryExtractor should use the thread context 
classloader
......................................................................

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
---
M 
java/kudu-test-utils/src/main/java/org/apache/kudu/test/cluster/KuduBinaryJarExtractor.java
M 
java/kudu-test-utils/src/test/java/org/apache/kudu/test/cluster/TestKuduBinaryJarExtractor.java
2 files changed, 60 insertions(+), 20 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/47/12147/1
--
To view, visit http://gerrit.cloudera.org:8080/12147
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e1cf188bb557eeaea0b2867243855f3f2d121f1
Gerrit-Change-Number: 12147
Gerrit-PatchSet: 1
Gerrit-Owner: Mike Percy <[email protected]>

Reply via email to