Java 类org.apache.hadoop.hbase.regionserver.SplitTransaction.LoggingProgressable 实例源码

项目:HIndex    文件:RegionMergeTransaction.java   
/**
 * Perform time consuming opening of the merged region.
 * @param server Hosting server instance. Can be null when testing (won't try
 *          and update in zk if a null server)
 * @param services Used to online/offline regions.
 * @param merged the merged region
 * @throws IOException If thrown, transaction failed. Call
 *           {@link #rollback(Server, RegionServerServices)}
 */
void openMergedRegion(final Server server,
    final RegionServerServices services, HRegion merged) throws IOException {
  boolean stopped = server != null && server.isStopped();
  boolean stopping = services != null && services.isStopping();
  if (stopped || stopping) {
    LOG.info("Not opening merged region  " + merged.getRegionNameAsString()
        + " because stopping=" + stopping + ", stopped=" + stopped);
    return;
  }
  HRegionInfo hri = merged.getRegionInfo();
  LoggingProgressable reporter = server == null ? null
      : new LoggingProgressable(hri, server.getConfiguration().getLong(
          "hbase.regionserver.regionmerge.open.log.interval", 10000));
  merged.openHRegion(reporter);

  if (services != null) {
    try {
      services.postOpenDeployTasks(merged, server.getCatalogTracker());
      services.addToOnlineRegions(merged);
    } catch (KeeperException ke) {
      throw new IOException(ke);
    }
  }

}
项目:PyroDB    文件:RegionMergeTransaction.java   
/**
 * Perform time consuming opening of the merged region.
 * @param server Hosting server instance. Can be null when testing (won't try
 *          and update in zk if a null server)
 * @param services Used to online/offline regions.
 * @param merged the merged region
 * @throws IOException If thrown, transaction failed. Call
 *           {@link #rollback(Server, RegionServerServices)}
 */
void openMergedRegion(final Server server,
    final RegionServerServices services, HRegion merged) throws IOException {
  boolean stopped = server != null && server.isStopped();
  boolean stopping = services != null && services.isStopping();
  if (stopped || stopping) {
    LOG.info("Not opening merged region  " + merged.getRegionNameAsString()
        + " because stopping=" + stopping + ", stopped=" + stopped);
    return;
  }
  HRegionInfo hri = merged.getRegionInfo();
  LoggingProgressable reporter = server == null ? null
      : new LoggingProgressable(hri, server.getConfiguration().getLong(
          "hbase.regionserver.regionmerge.open.log.interval", 10000));
  merged.openHRegion(reporter);

  if (services != null) {
    try {
      services.postOpenDeployTasks(merged, server.getCatalogTracker());
      services.addToOnlineRegions(merged);
    } catch (KeeperException ke) {
      throw new IOException(ke);
    }
  }

}
项目:c5    文件:RegionMergeTransaction.java   
/**
 * Perform time consuming opening of the merged region.
 * @param server Hosting server instance. Can be null when testing (won't try
 *          and update in zk if a null server)
 * @param services Used to online/offline regions.
 * @param merged the merged region
 * @throws IOException If thrown, transaction failed. Call
 *           {@link #rollback(Server, RegionServerServices)}
 */
void openMergedRegion(final Server server,
    final RegionServerServices services, HRegion merged) throws IOException {
  boolean stopped = server != null && server.isStopped();
  boolean stopping = services != null && services.isStopping();
  if (stopped || stopping) {
    LOG.info("Not opening merged region  " + merged.getRegionNameAsString()
        + " because stopping=" + stopping + ", stopped=" + stopped);
    return;
  }
  HRegionInfo hri = merged.getRegionInfo();
  LoggingProgressable reporter = server == null ? null
      : new LoggingProgressable(hri, server.getConfiguration().getLong(
          "hbase.regionserver.regionmerge.open.log.interval", 10000));
  merged.openHRegion(reporter);

  if (services != null) {
    try {
      services.postOpenDeployTasks(merged, server.getCatalogTracker());
      services.addToOnlineRegions(merged);
    } catch (KeeperException ke) {
      throw new IOException(ke);
    }
  }

}
项目:pbase    文件:RegionMergeTransaction.java   
/**
 * Perform time consuming opening of the merged region.
 * @param server Hosting server instance. Can be null when testing
 * @param services Used to online/offline regions.
 * @param merged the merged region
 * @throws IOException If thrown, transaction failed. Call
 *           {@link #rollback(Server, RegionServerServices)}
 */
void openMergedRegion(final Server server,
    final RegionServerServices services, HRegion merged) throws IOException {
  boolean stopped = server != null && server.isStopped();
  boolean stopping = services != null && services.isStopping();
  if (stopped || stopping) {
    LOG.info("Not opening merged region  " + merged.getRegionNameAsString()
        + " because stopping=" + stopping + ", stopped=" + stopped);
    return;
  }
  HRegionInfo hri = merged.getRegionInfo();
  LoggingProgressable reporter = server == null ? null
      : new LoggingProgressable(hri, server.getConfiguration().getLong(
          "hbase.regionserver.regionmerge.open.log.interval", 10000));
  merged.openHRegion(reporter);

  if (services != null) {
    try {
      if (useCoordinationForAssignment) {
        services.postOpenDeployTasks(merged);
      } else if (!services.reportRegionStateTransition(TransitionCode.MERGED,
          mergedRegionInfo, region_a.getRegionInfo(), region_b.getRegionInfo())) {
        throw new IOException("Failed to report merged region to master: "
          + mergedRegionInfo.getShortNameToLog());
      }
      services.addToOnlineRegions(merged);
    } catch (KeeperException ke) {
      throw new IOException(ke);
    }
  }

}