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

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

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

HStore.compactRecentForTestingAssumingDefaultPolicy介绍

[英]This method tries to compact N recent files for testing. Note that because compacting "recent" files only makes sense for some policies, e.g. the default one, it assumes default policy is used. It doesn't use policy, but instead makes a compaction candidate list by itself.
[中]此方法尝试压缩N个最近的文件以进行测试。请注意,由于压缩“最近”的文件仅对某些策略(例如默认策略)有意义,因此它假定使用默认策略。它不使用策略,而是自行生成压缩候选列表。

代码示例

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

store.compactRecentForTestingAssumingDefaultPolicy(totalNumFiles);
} else {
 region.compact(false);

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

int numFiles1 = store2.getStorefiles().size();
assertTrue("Was expecting to see 4 store files", numFiles1 > compactionThreshold); // > 3
((HStore)store2).compactRecentForTestingAssumingDefaultPolicy(compactionThreshold);   // = 3
int numFiles2 = store2.getStorefiles().size();

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

@Test(timeout=120000)
public void testCompactNonPhoenixTable() throws Exception {
  try (Connection conn = getConnection()) {
    // create a vanilla HBase table (non-Phoenix)
    String randomTable = generateUniqueName();
    TableName hbaseTN = TableName.valueOf(randomTable);
    byte[] famBytes = Bytes.toBytes("fam");
    Table hTable = getUtility().createTable(hbaseTN, famBytes);
    TestUtil.addCoprocessor(conn, randomTable, UngroupedAggregateRegionObserver.class);
    Put put = new Put(Bytes.toBytes("row"));
    byte[] value = new byte[1];
    Bytes.random(value);
    put.addColumn(famBytes, Bytes.toBytes("colQ"), value);
    hTable.put(put);
    // major compaction shouldn't cause a timeout or RS abort
    List<HRegion> regions = getUtility().getHBaseCluster().getRegions(hbaseTN);
    HRegion hRegion = regions.get(0);
    hRegion.flush(true);
    HStore store = hRegion.getStore(famBytes);
    store.triggerMajorCompaction();
    store.compactRecentForTestingAssumingDefaultPolicy(1);
    // we should be able to compact syscat itself as well
    regions = getUtility().getHBaseCluster().getRegions(TableName.valueOf(PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME));
    hRegion = regions.get(0);
    hRegion.flush(true);
    store = hRegion.getStore(QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES);
    store.triggerMajorCompaction();
    store.compactRecentForTestingAssumingDefaultPolicy(1);
  }
}

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

store.compactRecentForTestingAssumingDefaultPolicy(totalNumFiles);
} else {
 region.compact(false);

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

int numFiles1 = store2.getStorefiles().size();
assertTrue("Was expecting to see 4 store files", numFiles1 > compactionThreshold); // > 3
((HStore)store2).compactRecentForTestingAssumingDefaultPolicy(compactionThreshold);   // = 3
int numFiles2 = store2.getStorefiles().size();

相关文章

HStore类方法