Java 类org.apache.hadoop.hbase.executor.ExecutorType 实例源码

项目:ditb    文件:TestSplitLogWorker.java   
@Before
public void setup() throws Exception {
  TEST_UTIL.startMiniZKCluster();
  Configuration conf = TEST_UTIL.getConfiguration();
  zkw = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(),
      "split-log-worker-tests", null);
  ds = new DummyServer(zkw, conf);
  ZKUtil.deleteChildrenRecursively(zkw, zkw.baseZNode);
  ZKUtil.createAndFailSilent(zkw, zkw.baseZNode);
  assertThat(ZKUtil.checkExists(zkw, zkw.baseZNode), not (is(-1)));
  LOG.debug(zkw.baseZNode + " created");
  ZKUtil.createAndFailSilent(zkw, zkw.splitLogZNode);
  assertThat(ZKUtil.checkExists(zkw, zkw.splitLogZNode), not (is(-1)));

  LOG.debug(zkw.splitLogZNode + " created");
  ZKUtil.createAndFailSilent(zkw, zkw.rsZNode);
  assertThat(ZKUtil.checkExists(zkw, zkw.rsZNode), not (is(-1)));

  SplitLogCounters.resetCounters();
  executorService = new ExecutorService("TestSplitLogWorker");
  executorService.startExecutorService(ExecutorType.RS_LOG_REPLAY_OPS, 10);
  this.mode = (conf.getBoolean(HConstants.DISTRIBUTED_LOG_REPLAY_KEY, false) ?
      RecoveryMode.LOG_REPLAY : RecoveryMode.LOG_SPLITTING);
}
项目:pbase    文件:TestSplitLogWorker.java   
@Before
public void setup() throws Exception {
  TEST_UTIL.startMiniZKCluster();
  Configuration conf = TEST_UTIL.getConfiguration();
  zkw = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(),
      "split-log-worker-tests", null);
  ds = new DummyServer(zkw, conf);
  ZKUtil.deleteChildrenRecursively(zkw, zkw.baseZNode);
  ZKUtil.createAndFailSilent(zkw, zkw.baseZNode);
  assertThat(ZKUtil.checkExists(zkw, zkw.baseZNode), not (is(-1)));
  LOG.debug(zkw.baseZNode + " created");
  ZKUtil.createAndFailSilent(zkw, zkw.splitLogZNode);
  assertThat(ZKUtil.checkExists(zkw, zkw.splitLogZNode), not (is(-1)));

  LOG.debug(zkw.splitLogZNode + " created");
  ZKUtil.createAndFailSilent(zkw, zkw.rsZNode);
  assertThat(ZKUtil.checkExists(zkw, zkw.rsZNode), not (is(-1)));

  SplitLogCounters.resetCounters();
  executorService = new ExecutorService("TestSplitLogWorker");
  executorService.startExecutorService(ExecutorType.RS_LOG_REPLAY_OPS, 10);
  this.mode = (conf.getBoolean(HConstants.DISTRIBUTED_LOG_REPLAY_KEY, false) ?
      RecoveryMode.LOG_REPLAY : RecoveryMode.LOG_SPLITTING);
}
项目:HIndex    文件:TestSplitLogWorker.java   
@Before
public void setup() throws Exception {
  TEST_UTIL.startMiniZKCluster();
  zkw = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(),
      "split-log-worker-tests", null);
  ZKUtil.deleteChildrenRecursively(zkw, zkw.baseZNode);
  ZKUtil.createAndFailSilent(zkw, zkw.baseZNode);
  assertTrue(ZKUtil.checkExists(zkw, zkw.baseZNode) != -1);
  LOG.debug(zkw.baseZNode + " created");
  ZKUtil.createAndFailSilent(zkw, zkw.splitLogZNode);
  assertTrue(ZKUtil.checkExists(zkw, zkw.splitLogZNode) != -1);
  LOG.debug(zkw.splitLogZNode + " created");
  ZKUtil.createAndFailSilent(zkw, zkw.rsZNode);
  assertTrue(ZKUtil.checkExists(zkw, zkw.rsZNode) != -1);
  SplitLogCounters.resetCounters();
  executorService = new ExecutorService("TestSplitLogWorker");
  executorService.startExecutorService(ExecutorType.RS_LOG_REPLAY_OPS, 10);
}
项目:hbase    文件:TestSplitLogWorker.java   
@Before
public void setup() throws Exception {
  TEST_UTIL.startMiniZKCluster();
  Configuration conf = TEST_UTIL.getConfiguration();
  zkw = new ZKWatcher(TEST_UTIL.getConfiguration(),
      "split-log-worker-tests", null);
  ds = new DummyServer(zkw, conf);
  ZKUtil.deleteChildrenRecursively(zkw, zkw.znodePaths.baseZNode);
  ZKUtil.createAndFailSilent(zkw, zkw.znodePaths.baseZNode);
  assertThat(ZKUtil.checkExists(zkw, zkw.znodePaths.baseZNode), not (is(-1)));
  LOG.debug(zkw.znodePaths.baseZNode + " created");
  ZKUtil.createAndFailSilent(zkw, zkw.znodePaths.splitLogZNode);
  assertThat(ZKUtil.checkExists(zkw, zkw.znodePaths.splitLogZNode), not (is(-1)));

  LOG.debug(zkw.znodePaths.splitLogZNode + " created");
  ZKUtil.createAndFailSilent(zkw, zkw.znodePaths.rsZNode);
  assertThat(ZKUtil.checkExists(zkw, zkw.znodePaths.rsZNode), not (is(-1)));

  SplitLogCounters.resetCounters();
  executorService = new ExecutorService("TestSplitLogWorker");
  executorService.startExecutorService(ExecutorType.RS_LOG_REPLAY_OPS, 10);
}
项目:hbase    文件:TestRegionOpen.java   
@Test(timeout = 60000)
public void testPriorityRegionIsOpenedWithSeparateThreadPool() throws Exception {
  final TableName tableName = TableName.valueOf(TestRegionOpen.class.getSimpleName());
  ThreadPoolExecutor exec = getRS().getExecutorService()
      .getExecutorThreadPool(ExecutorType.RS_OPEN_PRIORITY_REGION);
  long completed = exec.getCompletedTaskCount();

  HTableDescriptor htd = new HTableDescriptor(tableName);
  htd.setPriority(HConstants.HIGH_QOS);
  htd.addFamily(new HColumnDescriptor(HConstants.CATALOG_FAMILY));
  try (Connection connection = ConnectionFactory.createConnection(HTU.getConfiguration());
      Admin admin = connection.getAdmin()) {
    admin.createTable(htd);
  }

  assertEquals(completed + 1, exec.getCompletedTaskCount());
}
项目:PyroDB    文件:TestSplitLogWorker.java   
@Before
public void setup() throws Exception {
  TEST_UTIL.startMiniZKCluster();
  zkw = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(),
      "split-log-worker-tests", null);
  ZKUtil.deleteChildrenRecursively(zkw, zkw.baseZNode);
  ZKUtil.createAndFailSilent(zkw, zkw.baseZNode);
  assertTrue(ZKUtil.checkExists(zkw, zkw.baseZNode) != -1);
  LOG.debug(zkw.baseZNode + " created");
  ZKUtil.createAndFailSilent(zkw, zkw.splitLogZNode);
  assertTrue(ZKUtil.checkExists(zkw, zkw.splitLogZNode) != -1);
  LOG.debug(zkw.splitLogZNode + " created");
  ZKUtil.createAndFailSilent(zkw, zkw.rsZNode);
  assertTrue(ZKUtil.checkExists(zkw, zkw.rsZNode) != -1);
  SplitLogCounters.resetCounters();
  executorService = new ExecutorService("TestSplitLogWorker");
  executorService.startExecutorService(ExecutorType.RS_LOG_REPLAY_OPS, 10);
}
项目:c5    文件:TestSplitLogWorker.java   
@Before
public void setup() throws Exception {
  TEST_UTIL.startMiniZKCluster();
  zkw = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(),
      "split-log-worker-tests", null);
  ZKUtil.deleteChildrenRecursively(zkw, zkw.baseZNode);
  ZKUtil.createAndFailSilent(zkw, zkw.baseZNode);
  assertTrue(ZKUtil.checkExists(zkw, zkw.baseZNode) != -1);
  LOG.debug(zkw.baseZNode + " created");
  ZKUtil.createAndFailSilent(zkw, zkw.splitLogZNode);
  assertTrue(ZKUtil.checkExists(zkw, zkw.splitLogZNode) != -1);
  LOG.debug(zkw.splitLogZNode + " created");
  ZKUtil.createAndFailSilent(zkw, zkw.rsZNode);
  assertTrue(ZKUtil.checkExists(zkw, zkw.rsZNode) != -1);
  SplitLogCounters.resetCounters();
  executorService = new ExecutorService("TestSplitLogWorker");
  executorService.startExecutorService(ExecutorType.RS_LOG_REPLAY_OPS, 10);
}
项目:ditb    文件:HMaster.java   
private void startServiceThreads() throws IOException{
 // Start the executor service pools
 this.service.startExecutorService(ExecutorType.MASTER_OPEN_REGION,
    conf.getInt("hbase.master.executor.openregion.threads", 5));
 this.service.startExecutorService(ExecutorType.MASTER_CLOSE_REGION,
    conf.getInt("hbase.master.executor.closeregion.threads", 5));
 this.service.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS,
    conf.getInt("hbase.master.executor.serverops.threads", 5));
 this.service.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS,
    conf.getInt("hbase.master.executor.serverops.threads", 5));
 this.service.startExecutorService(ExecutorType.M_LOG_REPLAY_OPS,
    conf.getInt("hbase.master.executor.logreplayops.threads", 10));

 // We depend on there being only one instance of this executor running
 // at a time.  To do concurrency, would need fencing of enable/disable of
 // tables.
 // Any time changing this maxThreads to > 1, pls see the comment at
 // AccessController#postCreateTableHandler
 this.service.startExecutorService(ExecutorType.MASTER_TABLE_OPERATIONS, 1);
 startProcedureExecutor();

 // Start log cleaner thread
 int cleanerInterval = conf.getInt("hbase.master.cleaner.interval", 60 * 1000);
 this.logCleaner =
    new LogCleaner(cleanerInterval,
       this, conf, getMasterFileSystem().getFileSystem(),
       getMasterFileSystem().getOldLogDir());
  getChoreService().scheduleChore(logCleaner);

 //start the hfile archive cleaner thread
  Path archiveDir = HFileArchiveUtil.getArchivePath(conf);
  this.hfileCleaner = new HFileCleaner(cleanerInterval, this, conf, getMasterFileSystem()
      .getFileSystem(), archiveDir);
  getChoreService().scheduleChore(hfileCleaner);
  serviceStarted = true;
  if (LOG.isTraceEnabled()) {
    LOG.trace("Started service threads");
  }
}
项目:ditb    文件:TestDrainingServer.java   
private ExecutorService startupMasterExecutor(final String name) {
  ExecutorService executor = new ExecutorService(name);
  executor.startExecutorService(ExecutorType.MASTER_OPEN_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_CLOSE_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS, 3);
  executor.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS, 3);
  return executor;
}
项目:pbase    文件:TestDrainingServer.java   
private ExecutorService startupMasterExecutor(final String name) {
  ExecutorService executor = new ExecutorService(name);
  executor.startExecutorService(ExecutorType.MASTER_OPEN_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_CLOSE_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS, 3);
  executor.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS, 3);
  return executor;
}
项目:pbase    文件:TestAssignmentManager.java   
/**
 * Create and startup executor pools. Start same set as master does (just
 * run a few less).
 * @param name Name to give our executor
 * @return Created executor (be sure to call shutdown when done).
 */
private ExecutorService startupMasterExecutor(final String name) {
  // TODO: Move up into HBaseTestingUtility?  Generally useful.
  ExecutorService executor = new ExecutorService(name);
  executor.startExecutorService(ExecutorType.MASTER_OPEN_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_CLOSE_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS, 3);
  executor.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS, 3);
  return executor;
}
项目:HIndex    文件:TestDrainingServer.java   
private ExecutorService startupMasterExecutor(final String name) {
  ExecutorService executor = new ExecutorService(name);
  executor.startExecutorService(ExecutorType.MASTER_OPEN_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_CLOSE_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS, 3);
  executor.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS, 3);
  return executor;
}
项目:HIndex    文件:TestAssignmentManager.java   
/**
 * Create and startup executor pools. Start same set as master does (just
 * run a few less).
 * @param name Name to give our executor
 * @return Created executor (be sure to call shutdown when done).
 */
private ExecutorService startupMasterExecutor(final String name) {
  // TODO: Move up into HBaseTestingUtility?  Generally useful.
  ExecutorService executor = new ExecutorService(name);
  executor.startExecutorService(ExecutorType.MASTER_OPEN_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_CLOSE_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS, 3);
  executor.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS, 3);
  return executor;
}
项目:PyroDB    文件:HMaster.java   
private void startServiceThreads() throws IOException{
 // Start the executor service pools
 this.service.startExecutorService(ExecutorType.MASTER_OPEN_REGION,
    conf.getInt("hbase.master.executor.openregion.threads", 5));
 this.service.startExecutorService(ExecutorType.MASTER_CLOSE_REGION,
    conf.getInt("hbase.master.executor.closeregion.threads", 5));
 this.service.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS,
    conf.getInt("hbase.master.executor.serverops.threads", 5));
 this.service.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS,
    conf.getInt("hbase.master.executor.serverops.threads", 5));
 this.service.startExecutorService(ExecutorType.M_LOG_REPLAY_OPS,
    conf.getInt("hbase.master.executor.logreplayops.threads", 10));

 // We depend on there being only one instance of this executor running
 // at a time.  To do concurrency, would need fencing of enable/disable of
 // tables.
 this.service.startExecutorService(ExecutorType.MASTER_TABLE_OPERATIONS, 1);

 // Start log cleaner thread
 int cleanerInterval = conf.getInt("hbase.master.cleaner.interval", 60 * 1000);
 this.logCleaner =
    new LogCleaner(cleanerInterval,
       this, conf, getMasterFileSystem().getFileSystem(),
       getMasterFileSystem().getOldLogDir());
       Threads.setDaemonThreadRunning(logCleaner.getThread(), getName() + ".oldLogCleaner");

 //start the hfile archive cleaner thread
  Path archiveDir = HFileArchiveUtil.getArchivePath(conf);
  this.hfileCleaner = new HFileCleaner(cleanerInterval, this, conf, getMasterFileSystem()
      .getFileSystem(), archiveDir);
  Threads.setDaemonThreadRunning(hfileCleaner.getThread(),
    getName() + ".archivedHFileCleaner");

  serviceStarted = true;
  if (LOG.isTraceEnabled()) {
    LOG.trace("Started service threads");
  }
}
项目:PyroDB    文件:TestDrainingServer.java   
private ExecutorService startupMasterExecutor(final String name) {
  ExecutorService executor = new ExecutorService(name);
  executor.startExecutorService(ExecutorType.MASTER_OPEN_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_CLOSE_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS, 3);
  executor.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS, 3);
  return executor;
}
项目:PyroDB    文件:TestAssignmentManager.java   
/**
 * Create and startup executor pools. Start same set as master does (just
 * run a few less).
 * @param name Name to give our executor
 * @return Created executor (be sure to call shutdown when done).
 */
private ExecutorService startupMasterExecutor(final String name) {
  // TODO: Move up into HBaseTestingUtility?  Generally useful.
  ExecutorService executor = new ExecutorService(name);
  executor.startExecutorService(ExecutorType.MASTER_OPEN_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_CLOSE_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS, 3);
  executor.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS, 3);
  return executor;
}
项目:c5    文件:TestDrainingServer.java   
private ExecutorService startupMasterExecutor(final String name) {
  ExecutorService executor = new ExecutorService(name);
  executor.startExecutorService(ExecutorType.MASTER_OPEN_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_CLOSE_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS, 3);
  executor.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS, 3);
  return executor;
}
项目:c5    文件:TestAssignmentManager.java   
/**
 * Create and startup executor pools. Start same set as master does (just
 * run a few less).
 * @param name Name to give our executor
 * @return Created executor (be sure to call shutdown when done).
 */
private ExecutorService startupMasterExecutor(final String name) {
  // TODO: Move up into HBaseTestingUtility?  Generally useful.
  ExecutorService executor = new ExecutorService(name);
  executor.startExecutorService(ExecutorType.MASTER_OPEN_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_CLOSE_REGION, 3);
  executor.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS, 3);
  executor.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS, 3);
  return executor;
}
项目:ditb    文件:HRegionServer.java   
private void startServiceThreads() throws IOException {
  // Start executor services
  this.service.startExecutorService(ExecutorType.RS_OPEN_REGION,
      conf.getInt("hbase.regionserver.executor.openregion.threads", 3));
  this.service.startExecutorService(ExecutorType.RS_OPEN_META,
      conf.getInt("hbase.regionserver.executor.openmeta.threads", 1));
  this.service.startExecutorService(ExecutorType.RS_CLOSE_REGION,
      conf.getInt("hbase.regionserver.executor.closeregion.threads", 3));
  this.service.startExecutorService(ExecutorType.RS_CLOSE_META,
      conf.getInt("hbase.regionserver.executor.closemeta.threads", 1));
  if (conf.getBoolean(StoreScanner.STORESCANNER_PARALLEL_SEEK_ENABLE, false)) {
    this.service.startExecutorService(ExecutorType.RS_PARALLEL_SEEK,
        conf.getInt("hbase.storescanner.parallel.seek.threads", 10));
  }
  this.service.startExecutorService(ExecutorType.RS_LOG_REPLAY_OPS,
      conf.getInt("hbase.regionserver.wal.max.splitters",
          SplitLogWorkerCoordination.DEFAULT_MAX_SPLITTERS));

  if (ServerRegionReplicaUtil.isRegionReplicaWaitForPrimaryFlushEnabled(conf)) {
    this.service.startExecutorService(ExecutorType.RS_REGION_REPLICA_FLUSH_OPS,
        conf.getInt("hbase.regionserver.region.replica.flusher.threads",
            conf.getInt("hbase.regionserver.executor.openregion.threads", 3)));
  }

  Threads.setDaemonThreadRunning(this.walRoller.getThread(), getName() + ".logRoller",
      uncaughtExceptionHandler);
  this.cacheFlusher.start(uncaughtExceptionHandler);

  if (this.compactionChecker != null) choreService.scheduleChore(compactionChecker);
  if (this.periodicFlusher != null) choreService.scheduleChore(periodicFlusher);
  if (this.healthCheckChore != null) choreService.scheduleChore(healthCheckChore);
  if (this.nonceManagerChore != null) choreService.scheduleChore(nonceManagerChore);
  if (this.storefileRefresher != null) choreService.scheduleChore(storefileRefresher);
  if (this.movedRegionsCleaner != null) choreService.scheduleChore(movedRegionsCleaner);

  // Leases is not a Thread. Internally it runs a daemon thread. If it gets
  // an unhandled exception, it will just exit.
  Threads.setDaemonThreadRunning(this.leases.getThread(), getName() + ".leaseChecker",
      uncaughtExceptionHandler);

  if (this.replicationSourceHandler == this.replicationSinkHandler
      && this.replicationSourceHandler != null) {
    this.replicationSourceHandler.startReplicationService();
  } else {
    if (this.replicationSourceHandler != null) {
      this.replicationSourceHandler.startReplicationService();
    }
    if (this.replicationSinkHandler != null) {
      this.replicationSinkHandler.startReplicationService();
    }
  }

  // Create the log splitting worker and start it
  // set a smaller retries to fast fail otherwise splitlogworker could be blocked for
  // quite a while inside HConnection layer. The worker won't be available for other
  // tasks even after current task is preempted after a split task times out.
  Configuration sinkConf = HBaseConfiguration.create(conf);
  sinkConf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
      conf.getInt("hbase.log.replay.retries.number", 8)); // 8 retries take about 23 seconds
  sinkConf.setInt(HConstants.HBASE_RPC_TIMEOUT_KEY,
      conf.getInt("hbase.log.replay.rpc.timeout", 30000)); // default 30 seconds
  sinkConf.setInt("hbase.client.serverside.retries.multiplier", 1);
  this.splitLogWorker = new SplitLogWorker(this, sinkConf, this, this, walFactory);
  splitLogWorker.start();
}
项目:pbase    文件:HMaster.java   
private void startServiceThreads() throws IOException {
    // Start the executor service pools
    this.service.startExecutorService(ExecutorType.MASTER_OPEN_REGION,
            conf.getInt("hbase.master.executor.openregion.threads", 5));
    this.service.startExecutorService(ExecutorType.MASTER_CLOSE_REGION,
            conf.getInt("hbase.master.executor.closeregion.threads", 5));
    this.service.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS,
            conf.getInt("hbase.master.executor.serverops.threads", 5));
    this.service.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS,
            conf.getInt("hbase.master.executor.serverops.threads", 5));
    this.service.startExecutorService(ExecutorType.M_LOG_REPLAY_OPS,
            conf.getInt("hbase.master.executor.logreplayops.threads", 10));

    // We depend on there being only one instance of this executor running
    // at a time.  To do concurrency, would need fencing of enable/disable of
    // tables.
    // Any time changing this maxThreads to > 1, pls see the comment at
    // AccessController#postCreateTableHandler
    this.service.startExecutorService(ExecutorType.MASTER_TABLE_OPERATIONS, 1);

    // Start log cleaner thread
    int cleanerInterval = conf.getInt("hbase.master.cleaner.interval", 60 * 1000);
    this.logCleaner =
            new LogCleaner(cleanerInterval,
                    this, conf, getMasterFileSystem().getFileSystem(),
                    getMasterFileSystem().getOldLogDir());
    Threads.setDaemonThreadRunning(logCleaner.getThread(),
            getServerName().toShortString() + ".oldLogCleaner");

    //start the hfile archive cleaner thread
    Path archiveDir = HFileArchiveUtil.getArchivePath(conf);
    this.hfileCleaner = new HFileCleaner(cleanerInterval, this, conf, getMasterFileSystem()
            .getFileSystem(), archiveDir);
    Threads.setDaemonThreadRunning(hfileCleaner.getThread(),
            getServerName().toShortString() + ".archivedHFileCleaner");

    serviceStarted = true;
    if (LOG.isTraceEnabled()) {
        LOG.trace("Started service threads");
    }
}
项目:pbase    文件:HRegionServer.java   
private void startServiceThreads() throws IOException {
    // Start executor services
    this.service.startExecutorService(ExecutorType.RS_OPEN_REGION,
            conf.getInt("hbase.regionserver.executor.openregion.threads", 3));
    this.service.startExecutorService(ExecutorType.RS_OPEN_META,
            conf.getInt("hbase.regionserver.executor.openmeta.threads", 1));
    this.service.startExecutorService(ExecutorType.RS_CLOSE_REGION,
            conf.getInt("hbase.regionserver.executor.closeregion.threads", 3));
    this.service.startExecutorService(ExecutorType.RS_CLOSE_META,
            conf.getInt("hbase.regionserver.executor.closemeta.threads", 1));
    if (conf.getBoolean(StoreScanner.STORESCANNER_PARALLEL_SEEK_ENABLE, false)) {
        this.service.startExecutorService(ExecutorType.RS_PARALLEL_SEEK,
                conf.getInt("hbase.storescanner.parallel.seek.threads", 10));
    }
    this.service.startExecutorService(ExecutorType.RS_LOG_REPLAY_OPS, conf.getInt(
            "hbase.regionserver.wal.max.splitters", SplitLogWorkerCoordination.DEFAULT_MAX_SPLITTERS));

    Threads.setDaemonThreadRunning(this.walRoller.getThread(), getName() + ".logRoller",
            uncaughtExceptionHandler);
    this.cacheFlusher.start(uncaughtExceptionHandler);
    Threads.setDaemonThreadRunning(this.compactionChecker.getThread(), getName() +
            ".compactionChecker", uncaughtExceptionHandler);
    Threads.setDaemonThreadRunning(this.periodicFlusher.getThread(), getName() +
            ".periodicFlusher", uncaughtExceptionHandler);
    if (this.healthCheckChore != null) {
        Threads.setDaemonThreadRunning(this.healthCheckChore.getThread(), getName() + ".healthChecker",
                uncaughtExceptionHandler);
    }
    if (this.nonceManagerChore != null) {
        Threads.setDaemonThreadRunning(this.nonceManagerChore.getThread(), getName() + ".nonceCleaner",
                uncaughtExceptionHandler);
    }
    if (this.storefileRefresher != null) {
        Threads.setDaemonThreadRunning(this.storefileRefresher.getThread(), getName() + ".storefileRefresher",
                uncaughtExceptionHandler);
    }

    // Leases is not a Thread. Internally it runs a daemon thread. If it gets
    // an unhandled exception, it will just exit.
    this.leases.setName(getName() + ".leaseChecker");
    this.leases.start();

    if (this.replicationSourceHandler == this.replicationSinkHandler &&
            this.replicationSourceHandler != null) {
        this.replicationSourceHandler.startReplicationService();
    } else {
        if (this.replicationSourceHandler != null) {
            this.replicationSourceHandler.startReplicationService();
        }
        if (this.replicationSinkHandler != null) {
            this.replicationSinkHandler.startReplicationService();
        }
    }

    // Create the log splitting worker and start it
    // set a smaller retries to fast fail otherwise splitlogworker could be blocked for
    // quite a while inside HConnection layer. The worker won't be available for other
    // tasks even after current task is preempted after a split task times out.
    Configuration sinkConf = HBaseConfiguration.create(conf);
    sinkConf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
            conf.getInt("hbase.log.replay.retries.number", 8)); // 8 retries take about 23 seconds
    sinkConf.setInt(HConstants.HBASE_RPC_TIMEOUT_KEY,
            conf.getInt("hbase.log.replay.rpc.timeout", 30000)); // default 30 seconds
    sinkConf.setInt("hbase.client.serverside.retries.multiplier", 1);
    this.splitLogWorker = new SplitLogWorker(this, sinkConf, this, this, walFactory);
    splitLogWorker.start();
}
项目:HIndex    文件:HMaster.java   
void startServiceThreads() throws IOException{
 // Start the executor service pools
 this.executorService.startExecutorService(ExecutorType.MASTER_OPEN_REGION,
    conf.getInt("hbase.master.executor.openregion.threads", 5));
 this.executorService.startExecutorService(ExecutorType.MASTER_CLOSE_REGION,
    conf.getInt("hbase.master.executor.closeregion.threads", 5));
 this.executorService.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS,
    conf.getInt("hbase.master.executor.serverops.threads", 5));
 this.executorService.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS,
    conf.getInt("hbase.master.executor.serverops.threads", 5));
 this.executorService.startExecutorService(ExecutorType.M_LOG_REPLAY_OPS,
    conf.getInt("hbase.master.executor.logreplayops.threads", 10));

 // We depend on there being only one instance of this executor running
 // at a time.  To do concurrency, would need fencing of enable/disable of
 // tables.
 // Any time changing this maxThreads to > 1, pls see the comment at
 // AccessController#postCreateTableHandler
 this.executorService.startExecutorService(ExecutorType.MASTER_TABLE_OPERATIONS, 1);

 // Start log cleaner thread
 String n = Thread.currentThread().getName();
 int cleanerInterval = conf.getInt("hbase.master.cleaner.interval", 60 * 1000);
 this.logCleaner =
    new LogCleaner(cleanerInterval,
       this, conf, getMasterFileSystem().getFileSystem(),
       getMasterFileSystem().getOldLogDir());
       Threads.setDaemonThreadRunning(logCleaner.getThread(), n + ".oldLogCleaner");

 //start the hfile archive cleaner thread
  Path archiveDir = HFileArchiveUtil.getArchivePath(conf);
  this.hfileCleaner = new HFileCleaner(cleanerInterval, this, conf, getMasterFileSystem()
      .getFileSystem(), archiveDir);
  Threads.setDaemonThreadRunning(hfileCleaner.getThread(), n + ".archivedHFileCleaner");

  // Start the health checker
  if (this.healthCheckChore != null) {
    Threads.setDaemonThreadRunning(this.healthCheckChore.getThread(), n + ".healthChecker");
  }

  // Start allowing requests to happen.
  this.rpcServer.openServer();
  this.rpcServerOpen = true;
  if (LOG.isTraceEnabled()) {
    LOG.trace("Started service threads");
  }
}
项目:HIndex    文件:HRegionServer.java   
private void startServiceThreads() throws IOException {
  String n = Thread.currentThread().getName();
  // Start executor services
  this.service = new ExecutorService(getServerName().toShortString());
  this.service.startExecutorService(ExecutorType.RS_OPEN_REGION,
    conf.getInt("hbase.regionserver.executor.openregion.threads", 3));
  this.service.startExecutorService(ExecutorType.RS_OPEN_META,
    conf.getInt("hbase.regionserver.executor.openmeta.threads", 1));
  this.service.startExecutorService(ExecutorType.RS_CLOSE_REGION,
    conf.getInt("hbase.regionserver.executor.closeregion.threads", 3));
  this.service.startExecutorService(ExecutorType.RS_CLOSE_META,
    conf.getInt("hbase.regionserver.executor.closemeta.threads", 1));
  if (conf.getBoolean(StoreScanner.STORESCANNER_PARALLEL_SEEK_ENABLE, false)) {
    this.service.startExecutorService(ExecutorType.RS_PARALLEL_SEEK,
      conf.getInt("hbase.storescanner.parallel.seek.threads", 10));
  }
  this.service.startExecutorService(ExecutorType.RS_LOG_REPLAY_OPS,
    conf.getInt("hbase.regionserver.wal.max.splitters", SplitLogWorker.DEFAULT_MAX_SPLITTERS));

  Threads.setDaemonThreadRunning(this.hlogRoller.getThread(), n + ".logRoller",
      uncaughtExceptionHandler);
  this.cacheFlusher.start(uncaughtExceptionHandler);
  Threads.setDaemonThreadRunning(this.compactionChecker.getThread(), n +
    ".compactionChecker", uncaughtExceptionHandler);
  Threads.setDaemonThreadRunning(this.periodicFlusher.getThread(), n +
      ".periodicFlusher", uncaughtExceptionHandler);
  if (this.healthCheckChore != null) {
    Threads.setDaemonThreadRunning(this.healthCheckChore.getThread(), n + ".healthChecker",
          uncaughtExceptionHandler);
  }
  if (this.nonceManagerChore != null) {
    Threads.setDaemonThreadRunning(this.nonceManagerChore.getThread(), n + ".nonceCleaner",
          uncaughtExceptionHandler);
  }

  // Leases is not a Thread. Internally it runs a daemon thread. If it gets
  // an unhandled exception, it will just exit.
  this.leases.setName(n + ".leaseChecker");
  this.leases.start();

  if (this.replicationSourceHandler == this.replicationSinkHandler &&
      this.replicationSourceHandler != null) {
    this.replicationSourceHandler.startReplicationService();
  } else {
    if (this.replicationSourceHandler != null) {
      this.replicationSourceHandler.startReplicationService();
    }
    if (this.replicationSinkHandler != null) {
      this.replicationSinkHandler.startReplicationService();
    }
  }

  // Start Server.  This service is like leases in that it internally runs
  // a thread.
  this.rpcServer.start();

  // Create the log splitting worker and start it
  // set a smaller retries to fast fail otherwise splitlogworker could be blocked for
  // quite a while inside HConnection layer. The worker won't be available for other
  // tasks even after current task is preempted after a split task times out.
  Configuration sinkConf = HBaseConfiguration.create(conf);
  sinkConf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
    conf.getInt("hbase.log.replay.retries.number", 8)); // 8 retries take about 23 seconds
  sinkConf.setInt(HConstants.HBASE_RPC_TIMEOUT_KEY,
    conf.getInt("hbase.log.replay.rpc.timeout", 30000)); // default 30 seconds
  sinkConf.setInt("hbase.client.serverside.retries.multiplier", 1);
  this.splitLogWorker = new SplitLogWorker(this.zooKeeper, sinkConf, this, this);
  splitLogWorker.start();
}
项目:hbase    文件:HMaster.java   
private void startServiceThreads() throws IOException{
 // Start the executor service pools
 this.executorService.startExecutorService(ExecutorType.MASTER_OPEN_REGION,
    conf.getInt("hbase.master.executor.openregion.threads", 5));
 this.executorService.startExecutorService(ExecutorType.MASTER_CLOSE_REGION,
    conf.getInt("hbase.master.executor.closeregion.threads", 5));
 this.executorService.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS,
    conf.getInt("hbase.master.executor.serverops.threads", 5));
 this.executorService.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS,
    conf.getInt("hbase.master.executor.meta.serverops.threads", 5));
 this.executorService.startExecutorService(ExecutorType.M_LOG_REPLAY_OPS,
    conf.getInt("hbase.master.executor.logreplayops.threads", 10));

 // We depend on there being only one instance of this executor running
 // at a time.  To do concurrency, would need fencing of enable/disable of
 // tables.
 // Any time changing this maxThreads to > 1, pls see the comment at
 // AccessController#postCompletedCreateTableAction
 this.executorService.startExecutorService(ExecutorType.MASTER_TABLE_OPERATIONS, 1);
 startProcedureExecutor();

 // Start log cleaner thread
 int cleanerInterval = conf.getInt("hbase.master.cleaner.interval", 600 * 1000);
 this.logCleaner =
    new LogCleaner(cleanerInterval,
       this, conf, getMasterWalManager().getFileSystem(),
       getMasterWalManager().getOldLogDir());
  getChoreService().scheduleChore(logCleaner);

 //start the hfile archive cleaner thread
  Path archiveDir = HFileArchiveUtil.getArchivePath(conf);
  Map<String, Object> params = new HashMap<>();
  params.put(MASTER, this);
  this.hfileCleaner = new HFileCleaner(cleanerInterval, this, conf, getMasterFileSystem()
      .getFileSystem(), archiveDir, params);
  getChoreService().scheduleChore(hfileCleaner);
  serviceStarted = true;
  if (LOG.isTraceEnabled()) {
    LOG.trace("Started service threads");
  }
  replicationMetaCleaner = new ReplicationMetaCleaner(this, this, cleanerInterval);
  getChoreService().scheduleChore(replicationMetaCleaner);
}
项目:PyroDB    文件:HRegionServer.java   
private void startServiceThreads() throws IOException {
  // Start executor services
  this.service.startExecutorService(ExecutorType.RS_OPEN_REGION,
    conf.getInt("hbase.regionserver.executor.openregion.threads", 3));
  this.service.startExecutorService(ExecutorType.RS_OPEN_META,
    conf.getInt("hbase.regionserver.executor.openmeta.threads", 1));
  this.service.startExecutorService(ExecutorType.RS_CLOSE_REGION,
    conf.getInt("hbase.regionserver.executor.closeregion.threads", 3));
  this.service.startExecutorService(ExecutorType.RS_CLOSE_META,
    conf.getInt("hbase.regionserver.executor.closemeta.threads", 1));
  if (conf.getBoolean(StoreScanner.STORESCANNER_PARALLEL_SEEK_ENABLE, false)) {
    this.service.startExecutorService(ExecutorType.RS_PARALLEL_SEEK,
      conf.getInt("hbase.storescanner.parallel.seek.threads", 10));
  }
  this.service.startExecutorService(ExecutorType.RS_LOG_REPLAY_OPS,
    conf.getInt("hbase.regionserver.wal.max.splitters", SplitLogWorker.DEFAULT_MAX_SPLITTERS));

  Threads.setDaemonThreadRunning(this.hlogRoller.getThread(), getName() + ".logRoller",
      uncaughtExceptionHandler);
  this.cacheFlusher.start(uncaughtExceptionHandler);
  Threads.setDaemonThreadRunning(this.compactionChecker.getThread(), getName() +
    ".compactionChecker", uncaughtExceptionHandler);
  Threads.setDaemonThreadRunning(this.periodicFlusher.getThread(), getName() +
      ".periodicFlusher", uncaughtExceptionHandler);
  if (this.healthCheckChore != null) {
    Threads.setDaemonThreadRunning(this.healthCheckChore.getThread(), getName() + ".healthChecker",
          uncaughtExceptionHandler);
  }
  if (this.nonceManagerChore != null) {
    Threads.setDaemonThreadRunning(this.nonceManagerChore.getThread(), getName() + ".nonceCleaner",
          uncaughtExceptionHandler);
  }

  // Leases is not a Thread. Internally it runs a daemon thread. If it gets
  // an unhandled exception, it will just exit.
  this.leases.setName(getName() + ".leaseChecker");
  this.leases.start();

  if (this.replicationSourceHandler == this.replicationSinkHandler &&
      this.replicationSourceHandler != null) {
    this.replicationSourceHandler.startReplicationService();
  } else {
    if (this.replicationSourceHandler != null) {
      this.replicationSourceHandler.startReplicationService();
    }
    if (this.replicationSinkHandler != null) {
      this.replicationSinkHandler.startReplicationService();
    }
  }

  // Start Server.  This service is like leases in that it internally runs
  // a thread.
  rpcServices.rpcServer.start();

  // Create the log splitting worker and start it
  // set a smaller retries to fast fail otherwise splitlogworker could be blocked for
  // quite a while inside HConnection layer. The worker won't be available for other
  // tasks even after current task is preempted after a split task times out.
  Configuration sinkConf = HBaseConfiguration.create(conf);
  sinkConf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
    conf.getInt("hbase.log.replay.retries.number", 8)); // 8 retries take about 23 seconds
  sinkConf.setInt(HConstants.HBASE_RPC_TIMEOUT_KEY,
    conf.getInt("hbase.log.replay.rpc.timeout", 30000)); // default 30 seconds
  sinkConf.setInt("hbase.client.serverside.retries.multiplier", 1);
  this.splitLogWorker = new SplitLogWorker(this.zooKeeper, sinkConf, this, this);
  splitLogWorker.start();
}
项目:c5    文件:HMaster.java   
void startServiceThreads() throws IOException{
 // Start the executor service pools
 this.executorService.startExecutorService(ExecutorType.MASTER_OPEN_REGION,
    conf.getInt("hbase.master.executor.openregion.threads", 5));
 this.executorService.startExecutorService(ExecutorType.MASTER_CLOSE_REGION,
    conf.getInt("hbase.master.executor.closeregion.threads", 5));
 this.executorService.startExecutorService(ExecutorType.MASTER_SERVER_OPERATIONS,
    conf.getInt("hbase.master.executor.serverops.threads", 5));
 this.executorService.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS,
    conf.getInt("hbase.master.executor.serverops.threads", 5));
 this.executorService.startExecutorService(ExecutorType.M_LOG_REPLAY_OPS,
    conf.getInt("hbase.master.executor.logreplayops.threads", 10));

 // We depend on there being only one instance of this executor running
 // at a time.  To do concurrency, would need fencing of enable/disable of
 // tables.
 this.executorService.startExecutorService(ExecutorType.MASTER_TABLE_OPERATIONS, 1);

 // Start log cleaner thread
 String n = Thread.currentThread().getName();
 int cleanerInterval = conf.getInt("hbase.master.cleaner.interval", 60 * 1000);
 this.logCleaner =
    new LogCleaner(cleanerInterval,
       this, conf, getMasterFileSystem().getFileSystem(),
       getMasterFileSystem().getOldLogDir());
       Threads.setDaemonThreadRunning(logCleaner.getThread(), n + ".oldLogCleaner");

 //start the hfile archive cleaner thread
  Path archiveDir = HFileArchiveUtil.getArchivePath(conf);
  this.hfileCleaner = new HFileCleaner(cleanerInterval, this, conf, getMasterFileSystem()
      .getFileSystem(), archiveDir);
  Threads.setDaemonThreadRunning(hfileCleaner.getThread(), n + ".archivedHFileCleaner");

  // Start the health checker
  if (this.healthCheckChore != null) {
    Threads.setDaemonThreadRunning(this.healthCheckChore.getThread(), n + ".healthChecker");
  }

  // Start allowing requests to happen.
  this.rpcServer.openServer();
  this.rpcServerOpen = true;
  if (LOG.isTraceEnabled()) {
    LOG.trace("Started service threads");
  }
}
项目:c5    文件:HRegionServer.java   
private void startServiceThreads() throws IOException {
  String n = Thread.currentThread().getName();
  // Start executor services
  this.service = new ExecutorService(getServerName().toShortString());
  this.service.startExecutorService(ExecutorType.RS_OPEN_REGION,
    conf.getInt("hbase.regionserver.executor.openregion.threads", 3));
  this.service.startExecutorService(ExecutorType.RS_OPEN_META,
    conf.getInt("hbase.regionserver.executor.openmeta.threads", 1));
  this.service.startExecutorService(ExecutorType.RS_CLOSE_REGION,
    conf.getInt("hbase.regionserver.executor.closeregion.threads", 3));
  this.service.startExecutorService(ExecutorType.RS_CLOSE_META,
    conf.getInt("hbase.regionserver.executor.closemeta.threads", 1));
  if (conf.getBoolean(StoreScanner.STORESCANNER_PARALLEL_SEEK_ENABLE, false)) {
    this.service.startExecutorService(ExecutorType.RS_PARALLEL_SEEK,
      conf.getInt("hbase.storescanner.parallel.seek.threads", 10));
  }
  this.service.startExecutorService(ExecutorType.RS_LOG_REPLAY_OPS,
    conf.getInt("hbase.regionserver.wal.max.splitters", SplitLogWorker.DEFAULT_MAX_SPLITTERS));

  Threads.setDaemonThreadRunning(this.hlogRoller.getThread(), n + ".logRoller",
      uncaughtExceptionHandler);
  this.cacheFlusher.start(uncaughtExceptionHandler);
  Threads.setDaemonThreadRunning(this.compactionChecker.getThread(), n +
    ".compactionChecker", uncaughtExceptionHandler);
  Threads.setDaemonThreadRunning(this.periodicFlusher.getThread(), n +
      ".periodicFlusher", uncaughtExceptionHandler);
  if (this.healthCheckChore != null) {
  Threads
      .setDaemonThreadRunning(this.healthCheckChore.getThread(), n + ".healthChecker",
          uncaughtExceptionHandler);
  }

  // Leases is not a Thread. Internally it runs a daemon thread. If it gets
  // an unhandled exception, it will just exit.
  this.leases.setName(n + ".leaseChecker");
  this.leases.start();

  // Put up the webui.  Webui may come up on port other than configured if
  // that port is occupied. Adjust serverInfo if this is the case.
  this.webuiport = putUpWebUI();

  if (this.replicationSourceHandler == this.replicationSinkHandler &&
      this.replicationSourceHandler != null) {
    this.replicationSourceHandler.startReplicationService();
  } else {
    if (this.replicationSourceHandler != null) {
      this.replicationSourceHandler.startReplicationService();
    }
    if (this.replicationSinkHandler != null) {
      this.replicationSinkHandler.startReplicationService();
    }
  }

  // Start Server.  This service is like leases in that it internally runs
  // a thread.
  this.rpcServer.start();

  // Create the log splitting worker and start it
  // set a smaller retries to fast fail otherwise splitlogworker could be blocked for
  // quite a while inside HConnection layer. The worker won't be available for other
  // tasks even after current task is preempted after a split task times out.
  Configuration sinkConf = HBaseConfiguration.create(conf);
  sinkConf.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
    conf.getInt("hbase.log.replay.retries.number", 8)); // 8 retries take about 23 seconds
  sinkConf.setInt(HConstants.HBASE_RPC_TIMEOUT_KEY,
    conf.getInt("hbase.log.replay.rpc.timeout", 30000)); // default 30 seconds
  sinkConf.setInt("hbase.client.serverside.retries.multiplier", 1);
  this.splitLogWorker = new SplitLogWorker(this.zooKeeper, sinkConf, this, this);
  splitLogWorker.start();
}