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

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

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

HStore.throttleCompaction介绍

暂无

代码示例

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

pool = store.throttleCompaction(compaction.getRequest().getSize()) ? longCompactions
   : shortCompactions;
} else {

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

@Test
public void testStoreUsesConfigurationFromHcdAndHtd() throws Exception {
 final String CONFIG_KEY = "hbase.regionserver.thread.compaction.throttle";
 long anyValue = 10;
 // We'll check that it uses correct config and propagates it appropriately by going thru
 // the simplest "real" path I can find - "throttleCompaction", which just checks whether
 // a number we pass in is higher than some config value, inside compactionPolicy.
 Configuration conf = HBaseConfiguration.create();
 conf.setLong(CONFIG_KEY, anyValue);
 init(name.getMethodName() + "-xml", conf);
 assertTrue(store.throttleCompaction(anyValue + 1));
 assertFalse(store.throttleCompaction(anyValue));
 // HTD overrides XML.
 --anyValue;
 init(name.getMethodName() + "-htd", conf, TableDescriptorBuilder
   .newBuilder(TableName.valueOf(table)).setValue(CONFIG_KEY, Long.toString(anyValue)),
  ColumnFamilyDescriptorBuilder.of(family));
 assertTrue(store.throttleCompaction(anyValue + 1));
 assertFalse(store.throttleCompaction(anyValue));
 // HCD overrides them both.
 --anyValue;
 init(name.getMethodName() + "-hcd", conf,
  TableDescriptorBuilder.newBuilder(TableName.valueOf(table)).setValue(CONFIG_KEY,
   Long.toString(anyValue)),
  ColumnFamilyDescriptorBuilder.newBuilder(family).setValue(CONFIG_KEY, Long.toString(anyValue))
    .build());
 assertTrue(store.throttleCompaction(anyValue + 1));
 assertFalse(store.throttleCompaction(anyValue));
}

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

store.throttleCompaction(c.getRequest().getSize()) ? longCompactions : shortCompactions;

代码示例来源:origin: org.apache.hbase/hbase-server

@Test
public void testStoreUsesConfigurationFromHcdAndHtd() throws Exception {
 final String CONFIG_KEY = "hbase.regionserver.thread.compaction.throttle";
 long anyValue = 10;
 // We'll check that it uses correct config and propagates it appropriately by going thru
 // the simplest "real" path I can find - "throttleCompaction", which just checks whether
 // a number we pass in is higher than some config value, inside compactionPolicy.
 Configuration conf = HBaseConfiguration.create();
 conf.setLong(CONFIG_KEY, anyValue);
 init(name.getMethodName() + "-xml", conf);
 assertTrue(store.throttleCompaction(anyValue + 1));
 assertFalse(store.throttleCompaction(anyValue));
 // HTD overrides XML.
 --anyValue;
 init(name.getMethodName() + "-htd", conf, TableDescriptorBuilder
   .newBuilder(TableName.valueOf(table)).setValue(CONFIG_KEY, Long.toString(anyValue)),
  ColumnFamilyDescriptorBuilder.of(family));
 assertTrue(store.throttleCompaction(anyValue + 1));
 assertFalse(store.throttleCompaction(anyValue));
 // HCD overrides them both.
 --anyValue;
 init(name.getMethodName() + "-hcd", conf,
  TableDescriptorBuilder.newBuilder(TableName.valueOf(table)).setValue(CONFIG_KEY,
   Long.toString(anyValue)),
  ColumnFamilyDescriptorBuilder.newBuilder(family).setValue(CONFIG_KEY, Long.toString(anyValue))
    .build());
 assertTrue(store.throttleCompaction(anyValue + 1));
 assertFalse(store.throttleCompaction(anyValue));
}

相关文章

HStore类方法