@Override public void call(MasterObserver observer) throws IOException { observer.preBalance(this); } });
@Override public void call(MasterObserver oserver, ObserverContext<MasterCoprocessorEnvironment> ctx) throws IOException { oserver.preBalance(ctx); } });
@Override public void preBalance(ObserverContext<MasterCoprocessorEnvironment> c) throws IOException { if(LOG.isDebugEnabled()) { LOG.debug("==> HBaseAtlasCoprocessor.preBalance()"); } try { activatePluginClassLoader(); implMasterObserver.preBalance(c); } finally { deactivatePluginClassLoader(); } if(LOG.isDebugEnabled()) { LOG.debug("<== HBaseAtlasCoprocessor.preBalance()"); } }
boolean preBalance() throws IOException { boolean bypass = false; ObserverContext<MasterCoprocessorEnvironment> ctx = null; for (MasterEnvironment env: coprocessors) { if (env.getInstance() instanceof MasterObserver) { ctx = ObserverContext.createAndPrepare(env, ctx); try { ((MasterObserver)env.getInstance()).preBalance(ctx); } catch (Throwable e) { handleCoprocessorThrowable(env, e); } bypass |= ctx.shouldBypass(); if (ctx.shouldComplete()) { break; } } } return bypass; }