@Test(timeout=60000) public void testAcquireMultiTasks() throws Exception { LOG.info("testAcquireMultiTasks"); SplitLogCounters.resetCounters(); final String TATAS = "tatas"; final ServerName RS = ServerName.valueOf("rs,1,1"); final int maxTasks = 3; Configuration testConf = HBaseConfiguration.create(TEST_UTIL.getConfiguration()); testConf.setInt("hbase.regionserver.wal.max.splitters", maxTasks); RegionServerServices mockedRS = getRegionServer(RS); for (int i = 0; i < maxTasks; i++) { zkw.getRecoverableZooKeeper().create(ZKSplitLog.getEncodedNodeName(zkw, TATAS + i), new SplitLogTask.Unassigned(ServerName.valueOf("mgr,1,1"), this.mode).toByteArray(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } SplitLogWorker slw = new SplitLogWorker(zkw, testConf, mockedRS, neverEndingTask); slw.start(); try { waitForCounter(SplitLogCounters.tot_wkr_task_acquired, 0, maxTasks, WAIT_TIME); for (int i = 0; i < maxTasks; i++) { byte[] bytes = ZKUtil.getData(zkw, ZKSplitLog.getEncodedNodeName(zkw, TATAS + i)); SplitLogTask slt = SplitLogTask.parseFrom(bytes); assertTrue(slt.isOwned(RS)); } } finally { stopSplitLogWorker(slw); } }
public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); } }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, RegionServerServices server,
      TaskExecutor splitTaskExecutor);  SplitLogWorker(final ZooKeeperWatcher watcher, final Configuration conf,
      final RegionServerServices server, final LastSequenceId sequenceIdChecker); }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, RegionServerServices server,
      TaskExecutor splitTaskExecutor);  SplitLogWorker(final ZooKeeperWatcher watcher, final Configuration conf,
      final RegionServerServices server, final LastSequenceId sequenceIdChecker); @Override void run(); @Override void nodeDataChanged(String path); @Override void nodeChildrenChanged(String path); void start(); void stop(); }
SplitLogWorker extends ZooKeeperListener implements Runnable { public void start() { worker = new Thread(null, this, "SplitLogWorker-" + serverName); exitWorker = false; worker.start(); } SplitLogWorker(ZooKeeperWatcher watcher, Configuration conf, RegionServerServices server,
      TaskExecutor splitTaskExecutor);  SplitLogWorker(final ZooKeeperWatcher watcher, final Configuration conf,
      final RegionServerServices server, final LastSequenceId sequenceIdChecker); @Override void run(); @Override void nodeDataChanged(String path); @Override void nodeChildrenChanged(String path); void start(); void stop(); static final int DEFAULT_MAX_SPLITTERS; }