HBASE-11898 CoprocessorHost.Environment should cache class loader instance. (Vladimir Rodionov)
This commit is contained in:
parent
aa05ad1291
commit
edac84567f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue