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

x33g5p2x  于2022-01-30 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(176)

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

Store.needsCompaction介绍

[英]See if there's too much store files in this store
[中]看看这家店的文件是否太多

代码示例

代码示例来源:origin: co.cask.hbase/hbase

/**
 * Checks every store to see if one has too many
 * store files
 * @return true if any store has too many store files
 */
public boolean needsCompaction() {
 for(Store store : stores.values()) {
  if(store.needsCompaction()) {
   return true;
  }
 }
 return false;
}

代码示例来源:origin: co.cask.hbase/hbase

private boolean updateStorefiles(final StoreFile sf,
                 final SortedSet<KeyValue> set)
throws IOException {
 this.lock.writeLock().lock();
 try {
  ArrayList<StoreFile> newList = new ArrayList<StoreFile>(storefiles);
  newList.add(sf);
  storefiles = sortAndClone(newList);
  this.memstore.clearSnapshot(set);
 } finally {
  // We need the lock, as long as we are updating the storefiles
  // or changing the memstore. Let us release it before calling
  // notifyChangeReadersObservers. See HBASE-4485 for a possible
  // deadlock scenario that could have happened if continue to hold
  // the lock.
  this.lock.writeLock().unlock();
 }
 // Tell listeners of the change in readers.
 notifyChangedReadersObservers();
 return needsCompaction();
}

代码示例来源:origin: co.cask.hbase/hbase

/**
 * Execute the actual compaction job.
 * If the compact once flag is not specified, execute the compaction until
 * no more compactions are needed. Uses the Configuration settings provided.
 */
private void compactStoreFiles(final HRegion region, final Path familyDir,
  final boolean compactOnce) throws IOException {
 LOG.info("Compact table=" + region.getTableDesc().getNameAsString() +
  " region=" + region.getRegionNameAsString() +
  " family=" + familyDir.getName());
 Store store = getStore(region, familyDir);
 do {
  CompactionRequest cr = store.requestCompaction();
  StoreFile storeFile = store.compact(cr);
  if (storeFile != null) {
   if (keepCompactedFiles && deleteCompacted) {
    fs.delete(storeFile.getPath(), false);
   }
  }
 } while (store.needsCompaction() && !compactOnce);
}

代码示例来源:origin: co.cask.hbase/hbase

@Override
 protected void chore() {
  for (HRegion r : this.instance.onlineRegions.values()) {
   if (r == null)
    continue;
   for (Store s : r.getStores().values()) {
    try {
     if (s.needsCompaction()) {
      // Queue a compaction. Will recognize if major is needed.
      this.instance.compactSplitThread.requestCompaction(r, s, getName()
        + " requests compaction", null);
     } else if (s.isMajorCompaction()) {
      if (majorCompactPriority == DEFAULT_PRIORITY
        || majorCompactPriority > r.getCompactPriority()) {
       this.instance.compactSplitThread.requestCompaction(r, s, getName()
         + " requests major compaction; use default priority", null);
      } else {
       this.instance.compactSplitThread.requestCompaction(r, s, getName()
         + " requests major compaction; use configured priority",
        this.majorCompactPriority, null);
      }
     }
    } catch (IOException e) {
     LOG.warn("Failed major compaction check on " + r, e);
    }
   }
  }
 }
}

代码示例来源:origin: co.cask.hbase/hbase

if (s.hasReferences() || s.needsCompaction()) {
 getCompactionRequester().requestCompaction(r, s, "Opening Region", null);

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

assert multiplier > 0;
if (iteration % multiplier != 0) continue;
if (s.needsCompaction()) {

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

if (s.hasReferences() || s.needsCompaction()) {
 this.compactSplitThread.requestSystemCompaction(r, s, "Opening Region");

相关文章