Skip to content

Commit

Permalink
Fixed failing test in AdminServiceBasicTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbansal committed Dec 13, 2009
1 parent 905f325 commit eefa763
Showing 1 changed file with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,22 +472,30 @@ public boolean isCompleteRequest(ByteBuffer buffer) {

/* Private helper methods */
private VoldemortFilter getFilterFromRequest(VAdminProto.VoldemortFilter request) {
VoldemortFilter filter;
if(voldemortConfig.isNetworkClassLoaderEnabled()) {
byte[] classBytes = ProtoUtils.decodeBytes(request.getData()).get();
String className = request.getName();

try {
Class<?> cl = networkClassLoader.loadClass(className,
classBytes,
0,
classBytes.length);
VoldemortFilter filter = null;

byte[] classBytes = ProtoUtils.decodeBytes(request.getData()).get();
String className = request.getName();

try {
if(voldemortConfig.isNetworkClassLoaderEnabled()) {
// TODO: network class loader was throwing NoClassDefFound for
// voldemort.server package classes, Need testing and fixes
// before can be reenabled.

// Class<?> cl = networkClassLoader.loadClass(className,
// classBytes,
// 0,
// classBytes.length);
// filter = (VoldemortFilter) cl.newInstance();
//
throw new VoldemortException("NetworkLoader is experimental and is disabled for now.");
} else {
Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(className);
filter = (VoldemortFilter) cl.newInstance();
} catch(Exception e) {
throw new VoldemortException("Failed to load and instantiate the filter class", e);
}
} else {
throw new VoldemortException("NetworkLoader is experimental and disabled by default.");
} catch(Exception e) {
throw new VoldemortException("Failed to load and instantiate the filter class", e);
}

return filter;
Expand Down

0 comments on commit eefa763

Please sign in to comment.