org.apache.hadoop.hbase.regionserver.HStore.hasReferences()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中org.apache.hadoop.hbase.regionserver.HStore.hasReferences()方法的一些代码示例,展示了HStore.hasReferences()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HStore.hasReferences()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.regionserver.HStore
类名称:HStore
方法名:hasReferences

HStore.hasReferences介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

@Override
public boolean canSplit() {
 this.lock.readLock().lock();
 try {
  // Not split-able if we find a reference store file present in the store.
  boolean result = !hasReferences();
  if (!result) {
   LOG.trace("Not splittable; has references: {}", this);
  }
  return result;
 } finally {
  this.lock.readLock().unlock();
 }
}

代码示例来源:origin: apache/hbase

/**
 * Determines if Store should be split.
 */
public Optional<byte[]> getSplitPoint() {
 this.lock.readLock().lock();
 try {
  // Should already be enforced by the split policy!
  assert !this.getRegionInfo().isMetaRegion();
  // Not split-able if we find a reference store file present in the store.
  if (hasReferences()) {
   LOG.trace("Not splittable; has references: {}", this);
   return Optional.empty();
  }
  return this.storeEngine.getStoreFileManager().getSplitPoint();
 } catch(IOException e) {
  LOG.warn("Failed getting store size for {}", this, e);
 } finally {
  this.lock.readLock().unlock();
 }
 return Optional.empty();
}

代码示例来源:origin: apache/hbase

@Override
public void postOpenDeployTasks(final PostOpenDeployContext context) throws IOException {
 HRegion r = context.getRegion();
 long masterSystemTime = context.getMasterSystemTime();
 rpcServices.checkOpen();
 LOG.info("Post open deploy tasks for " + r.getRegionInfo().getRegionNameAsString());
 // Do checks to see if we need to compact (references or too many files)
 for (HStore s : r.stores.values()) {
  if (s.hasReferences() || s.needsCompaction()) {
   this.compactSplitThread.requestSystemCompaction(r, s, "Opening Region");
  }
 }
 long openSeqNum = r.getOpenSeqNum();
 if (openSeqNum == HConstants.NO_SEQNUM) {
  // If we opened a region, we should have read some sequence number from it.
  LOG.error(
   "No sequence number found when opening " + r.getRegionInfo().getRegionNameAsString());
  openSeqNum = 0;
 }
 // Notify master
 if (!reportRegionStateTransition(new RegionStateTransitionContext(TransitionCode.OPENED,
  openSeqNum, masterSystemTime, r.getRegionInfo()))) {
  throw new IOException(
   "Failed to report opened region to master: " + r.getRegionInfo().getRegionNameAsString());
 }
 triggerFlushInPrimaryRegion(r);
 LOG.debug("Finished post open deploy task for " + r.getRegionInfo().getRegionNameAsString());
}

代码示例来源:origin: harbby/presto-connectors

@Override
public boolean canSplit() {
 this.lock.readLock().lock();
 try {
  // Not split-able if we find a reference store file present in the store.
  boolean result = !hasReferences();
  if (!result && LOG.isDebugEnabled()) {
   LOG.debug("Cannot split region due to reference files being there");
  }
  return result;
 } finally {
  this.lock.readLock().unlock();
 }
}

代码示例来源:origin: harbby/presto-connectors

@Override
public byte[] getSplitPoint() {
 this.lock.readLock().lock();
 try {
  // Should already be enforced by the split policy!
  assert !this.getRegionInfo().isMetaRegion();
  // Not split-able if we find a reference store file present in the store.
  if (hasReferences()) {
   return null;
  }
  return this.storeEngine.getStoreFileManager().getSplitPoint();
 } catch(IOException e) {
  LOG.warn("Failed getting store size for " + this, e);
 } finally {
  this.lock.readLock().unlock();
 }
 return null;
}

相关文章

HStore类方法