当前位置: 首页>>代码示例>>Java>>正文


Java HasThread类代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.util.HasThread的典型用法代码示例。如果您正苦于以下问题:Java HasThread类的具体用法?Java HasThread怎么用?Java HasThread使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HasThread类属于org.apache.hadoop.hbase.util包,在下文中一共展示了HasThread类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startAssignmentThread

import org.apache.hadoop.hbase.util.HasThread; //导入依赖的package包/类
private void startAssignmentThread() {
  // Get Server Thread name. Sometimes the Server is mocked so may not implement HasThread.
  // For example, in tests.
  String name = master instanceof HasThread? ((HasThread)master).getName():
      master.getServerName().toShortString();
  assignThread = new Thread(name) {
    @Override
    public void run() {
      while (isRunning()) {
        processAssignQueue();
      }
      pendingAssignQueue.clear();
    }
  };
  assignThread.setDaemon(true);
  assignThread.start();
}
 
开发者ID:apache,项目名称:hbase,代码行数:18,代码来源:AssignmentManager.java

示例2: SplitLogManager

import org.apache.hadoop.hbase.util.HasThread; //导入依赖的package包/类
/**
 * Its OK to construct this object even when region-servers are not online. It does lookup the
 * orphan tasks in coordination engine but it doesn't block waiting for them to be done.
 * @param master the master services
 * @param conf the HBase configuration
 * @throws IOException
 */
public SplitLogManager(MasterServices master, Configuration conf)
    throws IOException {
  this.server = master;
  this.conf = conf;
  // Get Server Thread name. Sometimes the Server is mocked so may not implement HasThread.
  // For example, in tests.
  String name = master instanceof HasThread? ((HasThread)master).getName():
      master.getServerName().toShortString();
  this.choreService =
      new ChoreService(name + ".splitLogManager.");
  if (server.getCoordinatedStateManager() != null) {
    SplitLogManagerCoordination coordination = getSplitLogManagerCoordination();
    Set<String> failedDeletions = Collections.synchronizedSet(new HashSet<String>());
    SplitLogManagerDetails details = new SplitLogManagerDetails(tasks, master, failedDeletions);
    coordination.setDetails(details);
    coordination.init();
  }
  this.unassignedTimeout =
      conf.getInt("hbase.splitlog.manager.unassigned.timeout", DEFAULT_UNASSIGNED_TIMEOUT);
  this.timeoutMonitor =
      new TimeoutMonitor(conf.getInt("hbase.splitlog.manager.timeoutmonitor.period", 1000),
          master);
  choreService.scheduleChore(timeoutMonitor);
}
 
开发者ID:apache,项目名称:hbase,代码行数:32,代码来源:SplitLogManager.java

示例3: setDaemonThreadRunning

import org.apache.hadoop.hbase.util.HasThread; //导入依赖的package包/类
public static HasThread setDaemonThreadRunning(final HasThread t,
		final String name, final UncaughtExceptionHandler handler) {
	t.setName(name);
	if (handler != null) {
		t.setUncaughtExceptionHandler(handler);
	}
	t.setDaemon(true);

	t.start();
	return t;
}
 
开发者ID:mayanhui,项目名称:hbase-secondary-index,代码行数:12,代码来源:TransactionalRegionServer.java


注:本文中的org.apache.hadoop.hbase.util.HasThread类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。