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

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

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

Store.getCompactionPressure介绍

[英]This value can represent the degree of emergency of compaction for this store. It should be greater than or equal to 0.0, any value greater than 1.0 means we have too many store files.

  • if getStorefilesCount <= getMinFilesToCompact, return 0.0
  • return (getStorefilesCount - getMinFilesToCompact) / (blockingFileCount - getMinFilesToCompact)

And for striped stores, we should calculate this value by the files in each stripe separately and return the maximum value.

It is similar to #getCompactPriority() except that it is more suitable to use in a linear formula.
[中]该值可以表示该商店的紧急压实程度。它应该大于或等于0.0,任何大于1.0的值都意味着存储文件太多。
*如果getStorefilesCount<=getMinFilesToCompact,则返回0.0
*return(getstorefilescont-getMinFilesToCompact)/(blockingFileCount-getMinFilesToCompact)
对于条带存储,我们应该通过每个条带中的文件分别计算这个值,并返回最大值。
它与#getCompactPriority()类似,只是更适合在线性公式中使用。

代码示例

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

@Override
public double getCompactionPressure() {
 double max = 0;
 for (Region region : onlineRegions.values()) {
  for (Store store : region.getStores()) {
   double normCount = store.getCompactionPressure();
   if (normCount > max) {
    max = normCount;
   }
  }
 }
 return max;
}

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

@Override
public double getCompactionPressure() {
 double max = 0;
 for (Region region : onlineRegions.values()) {
  for (Store store : region.getStores()) {
   double normCount = store.getCompactionPressure();
   if (normCount > max) {
    max = normCount;
   }
  }
 }
 return max;
}

相关文章