@Before public void setUp() throws Exception { htu = new HBaseCommonTestingUtility(); // NOTE: The executor will be created by each test procEnv = new TestProcEnv(); procStore = new NoopProcedureStore(); procStore.start(1); }
@Override public void start(int numThreads) throws IOException { if (!setRunning(true)) { return; } this.numThreads = numThreads; }
public static <TEnv> long submitAndWait(Configuration conf, TEnv env, Procedure<TEnv> proc) throws IOException { NoopProcedureStore procStore = new NoopProcedureStore(); ProcedureExecutor<TEnv> procExecutor = new ProcedureExecutor<>(conf, env, procStore); procStore.start(1); initAndStartWorkers(procExecutor, 1, false, true); try { return submitAndWait(procExecutor, proc, HConstants.NO_NONCE, HConstants.NO_NONCE); } finally { procStore.stop(false); procExecutor.stop(); } }
private void startProcedureExecutor(final RSProcedureDispatcher remoteDispatcher) throws IOException { final Configuration conf = getConfiguration(); this.procedureStore = new NoopProcedureStore(); this.procedureStore.registerListener(new ProcedureStoreListener() { @Override public void abortProcess() { abort("The Procedure Store lost the lease", null); } }); this.procedureEnv = new MasterProcedureEnv(this, remoteDispatcher != null ? remoteDispatcher : new RSProcedureDispatcher(this)); this.procedureExecutor = new ProcedureExecutor<>(conf, procedureEnv, procedureStore, procedureEnv.getProcedureScheduler()); final int numThreads = conf.getInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, Math.max(Runtime.getRuntime().availableProcessors(), MasterProcedureConstants.DEFAULT_MIN_MASTER_PROCEDURE_THREADS)); final boolean abortOnCorruption = conf.getBoolean( MasterProcedureConstants.EXECUTOR_ABORT_ON_CORRUPTION, MasterProcedureConstants.DEFAULT_EXECUTOR_ABORT_ON_CORRUPTION); this.procedureStore.start(numThreads); ProcedureTestingUtility.initAndStartWorkers(procedureExecutor, numThreads, abortOnCorruption); this.procedureEnv.getRemoteDispatcher().start(); }
@After public void tearDown() throws IOException { procExecutor.stop(); procStore.stop(false); }
@Before public void setUp() throws IOException { htu = new HBaseCommonTestingUtility(); procStore = new NoopProcedureStore(); procExecutor = new ProcedureExecutor<>(htu.getConfiguration(), new TestProcEnv(), procStore); procStore.start(PROCEDURE_EXECUTOR_SLOTS); ProcedureTestingUtility.initAndStartWorkers(procExecutor, PROCEDURE_EXECUTOR_SLOTS, true); }
@After public void tearDown() throws Exception { procExecutor.stop(); procStore.stop(false); procExecutor.join(); }
@Before public void setUp() throws IOException { htu = new HBaseCommonTestingUtility(); procEnv = new TestProcEnv(); procStore = new NoopProcedureStore(); procExecutor = new ProcedureExecutor<>(htu.getConfiguration(), procEnv, procStore); procExecutor.testing = new ProcedureExecutor.Testing(); procStore.start(PROCEDURE_EXECUTOR_SLOTS); ProcedureTestingUtility.initAndStartWorkers(procExecutor, PROCEDURE_EXECUTOR_SLOTS, true); }
public static <TEnv> long submitAndWait(Configuration conf, TEnv env, Procedure<TEnv> proc) throws IOException { NoopProcedureStore procStore = new NoopProcedureStore(); ProcedureExecutor<TEnv> procExecutor = new ProcedureExecutor<>(conf, env, procStore); procStore.start(1); procExecutor.start(1, false); try { return submitAndWait(procExecutor, proc, HConstants.NO_NONCE, HConstants.NO_NONCE); } finally { procStore.stop(false); procExecutor.stop(); } }
@Override public void stop(boolean abort) { setRunning(false); }
private void startProcedureExecutor(final RSProcedureDispatcher remoteDispatcher) throws IOException { final Configuration conf = getConfiguration(); this.procedureStore = new NoopProcedureStore(); this.procedureStore.registerListener(new ProcedureStoreListener() { @Override public void abortProcess() { abort("The Procedure Store lost the lease", null); } }); this.procedureEnv = new MasterProcedureEnv(this, remoteDispatcher != null ? remoteDispatcher : new RSProcedureDispatcher(this)); this.procedureExecutor = new ProcedureExecutor<>(conf, procedureEnv, procedureStore, procedureEnv.getProcedureScheduler()); final int numThreads = conf.getInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, Math.max(Runtime.getRuntime().availableProcessors(), MasterProcedureConstants.DEFAULT_MIN_MASTER_PROCEDURE_THREADS)); final boolean abortOnCorruption = conf.getBoolean( MasterProcedureConstants.EXECUTOR_ABORT_ON_CORRUPTION, MasterProcedureConstants.DEFAULT_EXECUTOR_ABORT_ON_CORRUPTION); this.procedureStore.start(numThreads); ProcedureTestingUtility.initAndStartWorkers(procedureExecutor, numThreads, abortOnCorruption); this.procedureEnv.getRemoteDispatcher().start(); }
@After public void tearDown() throws IOException { procExecutor.stop(); procStore.stop(false); }
@Before public void setUp() throws Exception { htu = new HBaseCommonTestingUtility(); // NOTE: The executor will be created by each test procEnv = new TestProcEnv(); procStore = new NoopProcedureStore(); procStore.start(1); }
public static <TEnv> long submitAndWait(Configuration conf, TEnv env, Procedure<TEnv> proc) throws IOException { NoopProcedureStore procStore = new NoopProcedureStore(); ProcedureExecutor<TEnv> procExecutor = new ProcedureExecutor<>(conf, env, procStore); procStore.start(1); initAndStartWorkers(procExecutor, 1, false, true); try { return submitAndWait(procExecutor, proc, HConstants.NO_NONCE, HConstants.NO_NONCE); } finally { procStore.stop(false); procExecutor.stop(); } }
@Override public void start(int numThreads) throws IOException { if (!setRunning(true)) { return; } this.numThreads = numThreads; }
@Before public void setUp() throws IOException { htu = new HBaseCommonTestingUtility(); procStore = new NoopProcedureStore(); procExecutor = new ProcedureExecutor(htu.getConfiguration(), new TestProcEnv(), procStore); procStore.start(PROCEDURE_EXECUTOR_SLOTS); procExecutor.start(PROCEDURE_EXECUTOR_SLOTS, true); }
@After public void tearDown() throws IOException { procExecutor.stop(); procStore.stop(false); }
@Before public void setUp() throws Exception { htu = new HBaseCommonTestingUtility(); // NOTE: The executor will be created by each test procEnv = new TestProcEnv(); procStore = new NoopProcedureStore(); procStore.start(1); }
@Override public void start(int numThreads) throws IOException { if (!setRunning(true)) { return; } this.numThreads = numThreads; }
@Before public void setUp() throws IOException { htu = new HBaseCommonTestingUtility(); procStore = new NoopProcedureStore(); procExecutor = new ProcedureExecutor<>(htu.getConfiguration(), new TestProcEnv(), procStore); procStore.start(PROCEDURE_EXECUTOR_SLOTS); ProcedureTestingUtility .initAndStartWorkers(procExecutor, PROCEDURE_EXECUTOR_SLOTS, 0, false, true); }