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


Java CancelableProgressable类代码示例

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


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

示例1: warmupHRegion

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
public static void warmupHRegion(final HRegionInfo info, final HTableDescriptor htd,
    final WAL wal, final Configuration conf, final RegionServerServices rsServices,
    final CancelableProgressable reporter) throws IOException {

  if (info == null) throw new NullPointerException("Passed region info is null");

  if (LOG.isDebugEnabled()) {
    LOG.debug("HRegion.Warming up region: " + info);
  }

  Path rootDir = FSUtils.getRootDir(conf);
  Path tableDir = FSUtils.getTableDir(rootDir, info.getTable());

  FileSystem fs = null;
  if (rsServices != null) {
    fs = rsServices.getFileSystem();
  }
  if (fs == null) {
    fs = FileSystem.get(conf);
  }

  HRegion r = HRegion.newHRegion(tableDir, wal, fs, conf, info, htd, null);
  r.initializeWarmup(reporter);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:25,代码来源:HRegion.java

示例2: initialize

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
/**
 * Initialize this region.
 *
 * @param reporter Tickle every so often if initialize is taking a while.
 * @return What the next sequence (edit) id should be.
 * @throws IOException e
 */
private long initialize(final CancelableProgressable reporter) throws IOException {
  MonitoredTask status = TaskMonitor.get().createStatus("Initializing region " + this);
  long nextSeqId = -1;
  try {
    nextSeqId = initializeRegionInternals(reporter, status);
    return nextSeqId;
  } finally {
    // nextSeqid will be -1 if the initialization fails.
    // At least it will be 0 otherwise.
    if (nextSeqId == -1) {
      status.abort("Exception during region " + getRegionInfo().getRegionNameAsString()
          + " initialization.");
    }
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:23,代码来源:HRegion.java

示例3: openHRegion

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
/**
 * Open HRegion. Calls initialize and sets sequenceId.
 *
 * @return Returns <code>this</code>
 * @throws IOException
 */
protected HRegion openHRegion(final CancelableProgressable reporter) throws IOException {
  // Refuse to open the region if we are missing local compression support
  checkCompressionCodecs();
  // Refuse to open the region if encryption configuration is incorrect or
  // codec support is missing
  checkEncryption();
  // Refuse to open the region if a required class cannot be loaded
  checkClassLoading();
  this.openSeqNum = initialize(reporter);
  this.mvcc.advanceTo(openSeqNum);
  if (wal != null && getRegionServerServices() != null && !writestate.readOnly && !recovering) {
    // Only write the region open event marker to WAL if (1) we are not
    // read-only
    // (2) dist log replay is off or we are not recovering. In case region is
    // recovering, the open event will be written at setRecovering(false)
    writeRegionOpenMarker(wal, openSeqNum);
  }
  return this;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:26,代码来源:HRegion.java

示例4: initialize

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
/**
 * Initialize this region.
 * @param reporter Tickle every so often if initialize is taking a while.
 * @return What the next sequence (edit) id should be.
 * @throws IOException e
 */
public long initialize(final CancelableProgressable reporter) throws IOException {

  MonitoredTask status = TaskMonitor.get().createStatus("Initializing region " + this);

  long nextSeqId = -1;
  try {
    nextSeqId = initializeRegionInternals(reporter, status);
    return nextSeqId;
  } finally {
    // nextSeqid will be -1 if the initialization fails.
    // At least it will be 0 otherwise.
    if (nextSeqId == -1) {
      status
          .abort("Exception during region " + this.getRegionNameAsString() + " initialization.");
    }
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:24,代码来源:HRegion.java

示例5: openHRegion

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
/**
 * Open a Region.
 * @param info Info for region to be opened
 * @param htd
 * @param wal HLog for region to use. This method will call HLog#setSequenceNumber(long) passing
 *          the result of the call to HRegion#getMinSequenceId() to ensure the log id is properly
 *          kept up. HRegionStore does this every time it opens a new region.
 * @param conf
 * @param rsServices An interface we can request flushes against.
 * @param reporter An interface we can report progress against.
 * @return new HRegion
 * @throws IOException
 */
public static HRegion openHRegion(final HRegionInfo info, final HTableDescriptor htd,
    final HLog wal, final Configuration conf, final RegionServerServices rsServices,
    final CancelableProgressable reporter) throws IOException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("Opening region: " + info);
  }
  if (info == null) {
    throw new NullPointerException("Passed region info is null");
  }
  Path dir = HTableDescriptor.getTableDir(FSUtils.getRootDir(conf), info.getTableName());
  FileSystem fs = null;
  if (rsServices != null) {
    fs = rsServices.getFileSystem();
  }
  if (fs == null) {
    fs = FileSystem.get(conf);
  }
  HRegion r = HRegion.newHRegion(dir, wal, fs, conf, info, htd, rsServices);
  return r.openHRegion(reporter);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:34,代码来源:HRegion.java

示例6: initialize

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
/**
 * Initialize this region.
 *
 * @param reporter Tickle every so often if initialize is taking a while.
 * @return What the next sequence (edit) id should be.
 * @throws IOException e
 */
private long initialize(final CancelableProgressable reporter) throws IOException {
    MonitoredTask status = TaskMonitor.get().createStatus("Initializing region " + this);
    long nextSeqId = -1;
    try {
        nextSeqId = initializeRegionInternals(reporter, status);
        return nextSeqId;
    } finally {
        // nextSeqid will be -1 if the initialization fails.
        // At least it will be 0 otherwise.
        if (nextSeqId == -1) {
            status
                    .abort("Exception during region " + this.getRegionNameAsString() + " initialization.");
        }
    }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:23,代码来源:HRegion.java

示例7: openHRegion

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
/**
 * Open HRegion.
 * Calls initialize and sets sequenceId.
 *
 * @return Returns <code>this</code>
 * @throws IOException
 */
protected HRegion openHRegion(final CancelableProgressable reporter)
        throws IOException {
    // Refuse to open the region if we are missing local compression support
    checkCompressionCodecs();
    // Refuse to open the region if encryption configuration is incorrect or
    // codec support is missing
    checkEncryption();
    // Refuse to open the region if a required class cannot be loaded
    checkClassLoading();
    this.openSeqNum = initialize(reporter);
    this.setSequenceId(openSeqNum);
    if (wal != null && getRegionServerServices() != null) {
        writeRegionOpenMarker(wal, openSeqNum);
    }
    return this;
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:24,代码来源:HRegion.java

示例8: initialize

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
/**
 * Initialize this region.
 *
 * @param reporter Tickle every so often if initialize is taking a while.
 * @return What the next sequence (edit) id should be.
 * @throws IOException e
 */
private long initialize(final CancelableProgressable reporter) throws IOException {
  MonitoredTask status = TaskMonitor.get().createStatus("Initializing region " + this);
  long nextSeqId = -1;
  try {
    nextSeqId = initializeRegionInternals(reporter, status);
    return nextSeqId;
  } finally {
    // nextSeqid will be -1 if the initialization fails.
    // At least it will be 0 otherwise.
    if (nextSeqId == -1) {
      status
          .abort("Exception during region " + this.getRegionNameAsString() + " initialization.");
    }
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:23,代码来源:HRegion.java

示例9: initialize

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
/**
 * Initialize this region.
 *
 * @param reporter Tickle every so often if initialize is taking a while.
 * @return What the next sequence (edit) id should be.
 * @throws IOException e
 */
public long initialize(final CancelableProgressable reporter)
    throws IOException {

  MonitoredTask status = TaskMonitor.get().createStatus(
      "Initializing region " + this);

  long nextSeqId = -1;
  try {
    nextSeqId = initializeRegionInternals(reporter, status);
    return nextSeqId;
  } finally {
    // nextSeqid will be -1 if the initialization fails.
    // At least it will be 0 otherwise.
    if (nextSeqId == -1) {
      status.abort("Exception during region " + this.getRegionNameAsString()
          + " initialization.");
    }
  }
}
 
开发者ID:wanhao,项目名称:IRIndex,代码行数:27,代码来源:HRegion.java

示例10: openHRegion

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
/**
 * Open a Region.
 * @param info Info for region to be opened
 * @param htd
 * @param wal HLog for region to use. This method will call
 * HLog#setSequenceNumber(long) passing the result of the call to
 * HRegion#getMinSequenceId() to ensure the log id is properly kept
 * up.  HRegionStore does this every time it opens a new region.
 * @param conf
 * @param rsServices An interface we can request flushes against.
 * @param reporter An interface we can report progress against.
 * @return new HRegion
 *
 * @throws IOException
 */
public static HRegion openHRegion(final HRegionInfo info,
  final HTableDescriptor htd, final HLog wal, final Configuration conf,
  final RegionServerServices rsServices,
  final CancelableProgressable reporter)
throws IOException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("Opening region: " + info);
  }
  if (info == null) {
    throw new NullPointerException("Passed region info is null");
  }
  Path dir = HTableDescriptor.getTableDir(FSUtils.getRootDir(conf),
    info.getTableName());
  FileSystem fs = null;
  if (rsServices != null) {
    fs = rsServices.getFileSystem();
  }
  if (fs == null) {
    fs = FileSystem.get(conf);
  }
  HRegion r = HRegion.newHRegion(dir, wal, fs, conf, info,
    htd, rsServices);
  return r.openHRegion(reporter);
}
 
开发者ID:wanhao,项目名称:IRIndex,代码行数:40,代码来源:HRegion.java

示例11: initialize

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
/**
 * Initialize this region.
 *
 * @param reporter Tickle every so often if initialize is taking a while.
 * @return What the next sequence (edit) id should be.
 * @throws IOException e
 */
private long initialize(final CancelableProgressable reporter) throws IOException {

  //Refuse to open the region if there is no column family in the table
  if (htableDescriptor.getColumnFamilyCount() == 0) {
    throw new DoNotRetryIOException("Table " + htableDescriptor.getTableName().getNameAsString()+
        " should have at least one column family.");
  }

  MonitoredTask status = TaskMonitor.get().createStatus("Initializing region " + this);
  long nextSeqId = -1;
  try {
    nextSeqId = initializeRegionInternals(reporter, status);
    return nextSeqId;
  } finally {
    // nextSeqid will be -1 if the initialization fails.
    // At least it will be 0 otherwise.
    if (nextSeqId == -1) {
      status.abort("Exception during region " + getRegionInfo().getRegionNameAsString() +
        " initialization.");
    }
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:30,代码来源:HRegion.java

示例12: openHRegion

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
/**
 * Open HRegion.
 * Calls initialize and sets sequenceId.
 * @return Returns <code>this</code>
 * @throws IOException
 */
protected HRegion openHRegion(final CancelableProgressable reporter)
throws IOException {
  // Refuse to open the region if we are missing local compression support
  checkCompressionCodecs();
  // Refuse to open the region if encryption configuration is incorrect or
  // codec support is missing
  checkEncryption();
  // Refuse to open the region if a required class cannot be loaded
  checkClassLoading();
  this.openSeqNum = initialize(reporter);
  this.mvcc.advanceTo(openSeqNum);
  if (wal != null && getRegionServerServices() != null && !writestate.readOnly) {
    // Only write the region open event marker to WAL if we are not read-only.
    writeRegionOpenMarker(wal, openSeqNum);
  }
  return this;
}
 
开发者ID:apache,项目名称:hbase,代码行数:24,代码来源:HRegion.java

示例13: warmupHRegion

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
public static void warmupHRegion(final RegionInfo info,
    final TableDescriptor htd, final WAL wal, final Configuration conf,
    final RegionServerServices rsServices,
    final CancelableProgressable reporter)
    throws IOException {

  if (info == null) throw new NullPointerException("Passed region info is null");

  if (LOG.isDebugEnabled()) {
    LOG.debug("HRegion.Warming up region: " + info);
  }

  Path rootDir = FSUtils.getRootDir(conf);
  Path tableDir = FSUtils.getTableDir(rootDir, info.getTable());

  FileSystem fs = null;
  if (rsServices != null) {
    fs = rsServices.getFileSystem();
  }
  if (fs == null) {
    fs = FileSystem.get(conf);
  }

  HRegion r = HRegion.newHRegion(tableDir, wal, fs, conf, info, htd, null);
  r.initializeWarmup(reporter);
}
 
开发者ID:apache,项目名称:hbase,代码行数:27,代码来源:HRegion.java

示例14: openRegion

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
/**
 * @return Instance of HRegion if successful open else null.
 */
HRegion openRegion() {
  HRegion region = null;
  try {
    // Instantiate the region.  This also periodically tickles our zk OPENING
    // state so master doesn't timeout this region in transition.
    region = HRegion.openHRegion(this.regionInfo, this.htd,
        this.rsServices.getWAL(), this.server.getConfiguration(),
        this.rsServices,
      new CancelableProgressable() {
        public boolean progress() {
          // We may lose the znode ownership during the open.  Currently its
          // too hard interrupting ongoing region open.  Just let it complete
          // and check we still have the znode after region open.
          return tickleOpening("open_region_progress");
        }
      });
  } catch (Throwable t) {
    // We failed open. Our caller will see the 'null' return value
    // and transition the node back to FAILED_OPEN. If that fails,
    // we rely on the Timeout Monitor in the master to reassign.
    LOG.error("Failed open of region=" +
      this.regionInfo.getRegionNameAsString(), t);
  }
  return region;
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:29,代码来源:OpenRegionHandler.java

示例15: openHRegion

import org.apache.hadoop.hbase.util.CancelableProgressable; //导入依赖的package包/类
/**
 * Open a Region.
 * @param info Info for region to be opened
 * @param htd
 * @param wal HLog for region to use. This method will call
 * HLog#setSequenceNumber(long) passing the result of the call to
 * HRegion#getMinSequenceId() to ensure the log id is properly kept
 * up.  HRegionStore does this every time it opens a new region.
 * @param conf
 * @param rsServices An interface we can request flushes against.
 * @param reporter An interface we can report progress against.
 * @return new HRegion
 *
 * @throws IOException
 */
public static HRegion openHRegion(final HRegionInfo info,
  final HTableDescriptor htd, final HLog wal, final Configuration conf,
  final RegionServerServices rsServices,
  final CancelableProgressable reporter)
throws IOException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("Opening region: " + info);
  }
  if (info == null) {
    throw new NullPointerException("Passed region info is null");
  }
  Path dir = HTableDescriptor.getTableDir(FSUtils.getRootDir(conf),
    info.getTableName());
  HRegion r = HRegion.newHRegion(dir, wal, FileSystem.get(conf), conf, info,
    htd, rsServices);
  return r.openHRegion(reporter);
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:33,代码来源:HRegion.java


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