HBASE-11898 CoprocessorHost.Environment should cache class loader instance. (Vladimir Rodionov)

This commit is contained in:
Lars Hofhansl 2014-09-05 09:46:58 -07:00
parent aa05ad1291
commit edac84567f
1 changed files with 3 additions and 1 deletions

View File

@ -350,6 +350,7 @@ public abstract class CoprocessorHost<E extends CoprocessorEnvironment> {
Collections.synchronizedList(new ArrayList<HTableInterface>());
private int seq;
private Configuration conf;
private ClassLoader classLoader;
/**
* Constructor
@ -359,6 +360,7 @@ public abstract class CoprocessorHost<E extends CoprocessorEnvironment> {
public Environment(final Coprocessor impl, final int priority,
final int seq, final Configuration conf) {
this.impl = impl;
this.classLoader = impl.getClass().getClassLoader();
this.priority = priority;
this.state = Coprocessor.State.INSTALLED;
this.seq = seq;
@ -423,7 +425,7 @@ public abstract class CoprocessorHost<E extends CoprocessorEnvironment> {
@Override
public ClassLoader getClassLoader() {
return impl.getClass().getClassLoader();
return classLoader;
}
@Override