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


Java Subprocedure类代码示例

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


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

示例1: buildSubprocedure

import org.apache.hadoop.hbase.procedure.Subprocedure; //导入依赖的package包/类
/**
 * If in a running state, creates the specified subprocedure for handling a backup procedure.
 * @return Subprocedure to submit to the ProcedureMemeber.
 */
public Subprocedure buildSubprocedure(byte[] data) {
  // don't run a backup if the parent is stop(ping)
  if (rss.isStopping() || rss.isStopped()) {
    throw new IllegalStateException("Can't start backup procedure on RS: " + rss.getServerName()
        + ", because stopping/stopped!");
  }

  LOG.info("Attempting to run a roll log procedure for backup.");
  ForeignExceptionDispatcher errorDispatcher = new ForeignExceptionDispatcher();
  Configuration conf = rss.getConfiguration();
  long timeoutMillis = conf.getLong(BACKUP_TIMEOUT_MILLIS_KEY, BACKUP_TIMEOUT_MILLIS_DEFAULT);
  long wakeMillis =
      conf.getLong(BACKUP_REQUEST_WAKE_MILLIS_KEY, BACKUP_REQUEST_WAKE_MILLIS_DEFAULT);

  LogRollBackupSubprocedurePool taskManager =
      new LogRollBackupSubprocedurePool(rss.getServerName().toString(), conf);
  return new LogRollBackupSubprocedure(rss, member, errorDispatcher, wakeMillis, timeoutMillis,
      taskManager, data);
}
 
开发者ID:apache,项目名称:hbase,代码行数:24,代码来源:LogRollRegionServerProcedureManager.java

示例2: buildSubprocedure

import org.apache.hadoop.hbase.procedure.Subprocedure; //导入依赖的package包/类
/**
 * If in a running state, creates the specified subprocedure to flush table regions.
 *
 * Because this gets the local list of regions to flush and not the set the master had,
 * there is a possibility of a race where regions may be missed.
 *
 * @param table
 * @return Subprocedure to submit to the ProcedureMemeber.
 */
public Subprocedure buildSubprocedure(String table) {

  // don't run the subprocedure if the parent is stop(ping)
  if (rss.isStopping() || rss.isStopped()) {
    throw new IllegalStateException("Can't start flush region subprocedure on RS: "
        + rss.getServerName() + ", because stopping/stopped!");
  }

  // check to see if this server is hosting any regions for the table
  List<Region> involvedRegions;
  try {
    involvedRegions = getRegionsToFlush(table);
  } catch (IOException e1) {
    throw new IllegalStateException("Failed to figure out if there is region to flush.", e1);
  }

  // We need to run the subprocedure even if we have no relevant regions.  The coordinator
  // expects participation in the procedure and without sending message the master procedure
  // will hang and fail.

  LOG.debug("Launching subprocedure to flush regions for " + table);
  ForeignExceptionDispatcher exnDispatcher = new ForeignExceptionDispatcher(table);
  Configuration conf = rss.getConfiguration();
  long timeoutMillis = conf.getLong(FLUSH_TIMEOUT_MILLIS_KEY,
      FLUSH_TIMEOUT_MILLIS_DEFAULT);
  long wakeMillis = conf.getLong(FLUSH_REQUEST_WAKE_MILLIS_KEY,
      FLUSH_REQUEST_WAKE_MILLIS_DEFAULT);

  FlushTableSubprocedurePool taskManager =
      new FlushTableSubprocedurePool(rss.getServerName().toString(), conf, rss);
  return new FlushTableSubprocedure(member, exnDispatcher, wakeMillis,
    timeoutMillis, involvedRegions, table, taskManager);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:43,代码来源:RegionServerFlushTableProcedureManager.java

示例3: buildSubprocedure

import org.apache.hadoop.hbase.procedure.Subprocedure; //导入依赖的package包/类
@Override
public Subprocedure buildSubprocedure(String name, byte[] data) {
  try {
    // unwrap the snapshot information
    SnapshotDescription snapshot = SnapshotDescription.parseFrom(data);
    return RegionServerSnapshotManager.this.buildSubprocedure(snapshot);
  } catch (InvalidProtocolBufferException e) {
    throw new IllegalArgumentException("Could not read snapshot information from request.");
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:RegionServerSnapshotManager.java

示例4: buildSubprocedure

import org.apache.hadoop.hbase.procedure.Subprocedure; //导入依赖的package包/类
/**
 * If in a running state, creates the specified subprocedure to flush table regions.
 *
 * Because this gets the local list of regions to flush and not the set the master had,
 * there is a possibility of a race where regions may be missed.
 *
 * @param table
 * @return Subprocedure to submit to the ProcedureMemeber.
 */
public Subprocedure buildSubprocedure(String table) {

  // don't run the subprocedure if the parent is stop(ping)
  if (rss.isStopping() || rss.isStopped()) {
    throw new IllegalStateException("Can't start flush region subprocedure on RS: "
        + rss.getServerName() + ", because stopping/stopped!");
  }

  // check to see if this server is hosting any regions for the table
  List<HRegion> involvedRegions;
  try {
    involvedRegions = getRegionsToFlush(table);
  } catch (IOException e1) {
    throw new IllegalStateException("Failed to figure out if there is region to flush.", e1);
  }

  // We need to run the subprocedure even if we have no relevant regions.  The coordinator
  // expects participation in the procedure and without sending message the master procedure
  // will hang and fail.

  LOG.debug("Launching subprocedure to flush regions for " + table);
  ForeignExceptionDispatcher exnDispatcher = new ForeignExceptionDispatcher(table);
  Configuration conf = rss.getConfiguration();
  long timeoutMillis = conf.getLong(FLUSH_TIMEOUT_MILLIS_KEY,
      FLUSH_TIMEOUT_MILLIS_DEFAULT);
  long wakeMillis = conf.getLong(FLUSH_REQUEST_WAKE_MILLIS_KEY,
      FLUSH_REQUEST_WAKE_MILLIS_DEFAULT);

  FlushTableSubprocedurePool taskManager =
      new FlushTableSubprocedurePool(rss.getServerName().toString(), conf);
  return new FlushTableSubprocedure(member, exnDispatcher, wakeMillis,
    timeoutMillis, involvedRegions, table, taskManager);
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:43,代码来源:RegionServerFlushTableProcedureManager.java

示例5: buildSubprocedure

import org.apache.hadoop.hbase.procedure.Subprocedure; //导入依赖的package包/类
/**
 * If in a running state, creates the specified subprocedure to flush table regions.
 *
 * Because this gets the local list of regions to flush and not the set the master had,
 * there is a possibility of a race where regions may be missed.
 *
 * @param table
 * @return Subprocedure to submit to the ProcedureMemeber.
 */
public Subprocedure buildSubprocedure(String table) {

  // don't run the subprocedure if the parent is stop(ping)
  if (rss.isStopping() || rss.isStopped()) {
    throw new IllegalStateException("Can't start flush region subprocedure on RS: "
        + rss.getServerName() + ", because stopping/stopped!");
  }

  // check to see if this server is hosting any regions for the table
  List<HRegion> involvedRegions;
  try {
    involvedRegions = getRegionsToFlush(table);
  } catch (IOException e1) {
    throw new IllegalStateException("Failed to figure out if there is region to flush.", e1);
  }

  // We need to run the subprocedure even if we have no relevant regions.  The coordinator
  // expects participation in the procedure and without sending message the master procedure
  // will hang and fail.

  LOG.debug("Launching subprocedure to flush regions for " + table);
  ForeignExceptionDispatcher exnDispatcher = new ForeignExceptionDispatcher(table);
  Configuration conf = rss.getConfiguration();
  long timeoutMillis = conf.getLong(FLUSH_TIMEOUT_MILLIS_KEY,
      FLUSH_TIMEOUT_MILLIS_DEFAULT);
  long wakeMillis = conf.getLong(FLUSH_REQUEST_WAKE_MILLIS_KEY,
      FLUSH_REQUEST_WAKE_MILLIS_DEFAULT);

  FlushTableSubprocedurePool taskManager =
      new FlushTableSubprocedurePool(rss.getServerName().toString(), conf, rss);
  return new FlushTableSubprocedure(member, exnDispatcher, wakeMillis,
    timeoutMillis, involvedRegions, table, taskManager);
}
 
开发者ID:apache,项目名称:hbase,代码行数:43,代码来源:RegionServerFlushTableProcedureManager.java

示例6: buildSubprocedure

import org.apache.hadoop.hbase.procedure.Subprocedure; //导入依赖的package包/类
@Override
public Subprocedure buildSubprocedure(String name, byte[] data) {
  try {
    // unwrap the snapshot information
    SnapshotDescription snapshot = SnapshotDescription.parseFrom(data);
    return RegionServerSnapshotManager.this.buildSubprocedure(snapshot);
  } catch (IOException e) {
    throw new IllegalArgumentException("Could not read snapshot information from request.");
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:11,代码来源:RegionServerSnapshotManager.java


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