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


Java Server.getCoordinatedStateManager方法代码示例

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


在下文中一共展示了Server.getCoordinatedStateManager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SplitLogManager

import org.apache.hadoop.hbase.Server; //导入方法依赖的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 server the server instance
 * @param conf the HBase configuration
 * @param stopper the stoppable in case anything is wrong
 * @param master the master services
 * @param serverName the master server name
 * @throws IOException
 */
public SplitLogManager(Server server, Configuration conf, Stoppable stopper,
    MasterServices master, ServerName serverName) throws IOException {
  this.server = server;
  this.conf = conf;
  this.stopper = stopper;
  this.choreService = new ChoreService(serverName.toString() + "_splitLogManager_");
  if (server.getCoordinatedStateManager() != null) {
    SplitLogManagerCoordination coordination =
        ((BaseCoordinatedStateManager) server.getCoordinatedStateManager())
            .getSplitLogManagerCoordination();
    Set<String> failedDeletions = Collections.synchronizedSet(new HashSet<String>());
    SplitLogManagerDetails details =
        new SplitLogManagerDetails(tasks, master, failedDeletions, serverName);
    coordination.setDetails(details);
    coordination.init();
    // Determine recovery mode
  }
  this.unassignedTimeout =
      conf.getInt("hbase.splitlog.manager.unassigned.timeout", DEFAULT_UNASSIGNED_TIMEOUT);
  this.timeoutMonitor =
      new TimeoutMonitor(conf.getInt("hbase.splitlog.manager.timeoutmonitor.period", 1000),
          stopper);
  choreService.scheduleChore(timeoutMonitor);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:35,代码来源:SplitLogManager.java

示例2: useCoordinatedStateManager

import org.apache.hadoop.hbase.Server; //导入方法依赖的package包/类
private boolean useCoordinatedStateManager(final Server server) {
  return server != null && useZKForAssignment && server.getCoordinatedStateManager() != null;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:4,代码来源:SplitTransactionImpl.java

示例3: execute

import org.apache.hadoop.hbase.Server; //导入方法依赖的package包/类
@Override
public HRegion execute(final Server server, final RegionServerServices services, User user)
    throws IOException {
  this.server = server;
  this.rsServices = services;
  useCoordinationForAssignment =
      server == null ? true : ConfigUtil.useZKForAssignment(server.getConfiguration());
  if (rmd == null) {
    rmd = server != null && server.getCoordinatedStateManager() != null ?
        ((BaseCoordinatedStateManager) server.getCoordinatedStateManager())
          .getRegionMergeCoordination().getDefaultDetails()
      : null;
  }
  if (rsCoprocessorHost == null) {
    rsCoprocessorHost = server != null ?
      ((HRegionServer) server).getRegionServerCoprocessorHost() : null;
  }
  final HRegion mergedRegion = createMergedRegion(server, services, user);
  if (rsCoprocessorHost != null) {
    if (user == null) {
      rsCoprocessorHost.postMergeCommit(this.region_a, this.region_b, mergedRegion);
    } else {
      try {
        user.getUGI().doAs(new PrivilegedExceptionAction<Void>() {
          @Override
          public Void run() throws Exception {
            rsCoprocessorHost.postMergeCommit(region_a, region_b, mergedRegion);
            return null;
          }
        });
      } catch (InterruptedException ie) {
        InterruptedIOException iioe = new InterruptedIOException();
        iioe.initCause(ie);
        throw iioe;
      }
    }
  }
  stepsAfterPONR(server, services, mergedRegion, user);

  transition(RegionMergeTransactionPhase.COMPLETED);

  return mergedRegion;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:44,代码来源:RegionMergeTransactionImpl.java

示例4: useCoordination

import org.apache.hadoop.hbase.Server; //导入方法依赖的package包/类
private boolean useCoordination(final Server server) {
  return server != null && useCoordinationForAssignment
      && server.getCoordinatedStateManager() != null;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:5,代码来源:RegionMergeTransactionImpl.java


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