/** * @param implClass Implementation class * @param priority priority * @param conf configuration * @throws java.io.IOException Exception */ public E checkAndLoadInstance(Class<?> implClass, int priority, Configuration conf) throws IOException { // create the instance C impl; try { impl = checkAndGetInstance(implClass); if (impl == null) { LOG.error("Cannot load coprocessor " + implClass.getSimpleName()); return null; } } catch (InstantiationException|IllegalAccessException e) { throw new IOException(e); } // create the environment E env = createEnvironment(impl, priority, loadSequence.incrementAndGet(), conf); assert env instanceof BaseEnvironment; ((BaseEnvironment<C>) env).startup(); // HBASE-4014: maintain list of loaded coprocessors for later crash analysis // if server (master or regionserver) aborts. coprocessorNames.add(implClass.getName()); return env; }
/** * @param implClass Implementation class * @param priority priority * @param conf configuration * @throws java.io.IOException Exception */ public E loadInstance(Class<?> implClass, int priority, Configuration conf) throws IOException { // create the instance Coprocessor impl; Object o = null; try { o = implClass.newInstance(); impl = (Coprocessor)o; } catch (InstantiationException e) { throw new IOException(e); } catch (IllegalAccessException e) { throw new IOException(e); } // create the environment E env = createEnvironment(implClass, impl, priority, ++loadSequence, conf); if (env instanceof Environment) { ((Environment)env).startup(); } // HBASE-4014: maintain list of loaded coprocessors for later crash analysis // if server (master or regionserver) aborts. coprocessorNames.add(implClass.getName()); return env; }
E env = createEnvironment(implClass, impl, priority, loadSequence.incrementAndGet(), conf); if (env instanceof Environment) { ((Environment)env).startup();