/** * @param inMemoryCompaction the prefered in-memory compaction policy for * this column family * @return this (for chained invocation) */ public ModifyableColumnFamilyDescriptor setInMemoryCompaction(MemoryCompactionPolicy inMemoryCompaction) { return setValue(IN_MEMORY_COMPACTION_BYTES, inMemoryCompaction.name()); }
@Override public MemoryCompactionPolicy getInMemoryCompaction() { return getStringOrDefault(IN_MEMORY_COMPACTION_BYTES, n -> MemoryCompactionPolicy.valueOf(n.toUpperCase()), null); }
@Test public void testDefaultInMemoryCompaction() { PerformanceEvaluation.TestOptions defaultOpts = new PerformanceEvaluation.TestOptions(); assertEquals(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_DEFAULT.toString(), defaultOpts.getInMemoryCompaction().toString()); HTableDescriptor htd = PerformanceEvaluation.getTableDescriptor(defaultOpts); for (HColumnDescriptor hcd: htd.getFamilies()) { assertEquals(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_DEFAULT.toString(), hcd.getInMemoryCompaction().toString()); } }
/** * Test that puts up a regionserver, starts a compaction on a loaded region but holds the * compaction completion until after we have killed the server and the region has come up on * a new regionserver altogether. This fakes the double assignment case where region in one * location changes the files out from underneath a region being served elsewhere. */ @Test public void testFencingAroundCompactionAfterWALSync() throws Exception { for(MemoryCompactionPolicy policy : MemoryCompactionPolicy.values()) { doTest(BlockCompactionsInCompletionRegion.class, policy); } }
/** * Test that puts up a regionserver, starts a compaction on a loaded region but holds the * compaction until after we have killed the server and the region has come up on * a new regionserver altogether. This fakes the double assignment case where region in one * location changes the files out from underneath a region being served elsewhere. */ @Test public void testFencingAroundCompaction() throws Exception { for(MemoryCompactionPolicy policy : MemoryCompactionPolicy.values()) { doTest(BlockCompactionsInPrepRegion.class, policy); } }
@Before public void setUp() throws Exception { MemoryCompactionPolicy policy = getMemoryCompactionPolicy(); TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(TABLE_NAME) .setValue(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_KEY, policy.name()); if (policy == MemoryCompactionPolicy.EAGER) { builder.setValue(MemStoreLAB.USEMSLAB_KEY, "false"); builder.setValue(CompactingMemStore.IN_MEMORY_FLUSH_THRESHOLD_FACTOR_KEY, "0.9"); } Stream.of(FAMILIES).map(ColumnFamilyDescriptorBuilder::of) .forEachOrdered(builder::setColumnFamily); UTIL.getAdmin().createTable(builder.build()); tool.setConf(UTIL.getConfiguration()); }
/** * HBASE-12782 ITBLL fails for me if generator does anything but 5M per maptask. * Create a region. Close it. Then copy into place a file to replay, one that is bigger than * configured flush size so we bring on lots of flushes. Then reopen and confirm all edits * made it in. * @throws IOException */ @Test public void testReplayWorksThoughLotsOfFlushing() throws IOException { for(MemoryCompactionPolicy policy : MemoryCompactionPolicy.values()) { testReplayWorksWithMemoryCompactionPolicy(policy); } }
@Test public void testDefaultInMemoryCompaction() { PerformanceEvaluation.TestOptions defaultOpts = new PerformanceEvaluation.TestOptions(); assertEquals(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_DEFAULT.toString(), defaultOpts.getInMemoryCompaction().toString()); HTableDescriptor htd = PerformanceEvaluation.getTableDescriptor(defaultOpts); for (HColumnDescriptor hcd: htd.getFamilies()) { assertEquals(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_DEFAULT.toString(), hcd.getInMemoryCompaction().toString()); } }
@BeforeClass public static void setUp() throws Exception { WriteHeavyIncrementObserverTestBase.setUp(); UTIL.getAdmin() .createTable(TableDescriptorBuilder.newBuilder(NAME) .setCoprocessor(WriteHeavyIncrementObserver.class.getName()) .setValue(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_KEY, MemoryCompactionPolicy.EAGER.name()) .setColumnFamily(ColumnFamilyDescriptorBuilder.of(FAMILY)).build()); TABLE = UTIL.getConnection().getTable(NAME); }
private HRegion initHRegion(String callingMethod, Configuration conf) throws IOException { int i=0; HTableDescriptor htd = new HTableDescriptor(TABLENAME); for (byte[] family : FAMILIES) { HColumnDescriptor hcd = new HColumnDescriptor(family); // even column families are going to have compacted memstore if(i%2 == 0) { hcd.setInMemoryCompaction(MemoryCompactionPolicy.valueOf( conf.get(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_KEY))); } else { hcd.setInMemoryCompaction(MemoryCompactionPolicy.NONE); } htd.addFamily(hcd); i++; } HRegionInfo info = new HRegionInfo(TABLENAME, null, null, false); Path path = new Path(DIR, callingMethod); return HBaseTestingUtility.createRegionAndWAL(info, path, conf, htd); }
/** * Test that puts up a regionserver, starts a compaction on a loaded region but holds the * compaction until after we have killed the server and the region has come up on * a new regionserver altogether. This fakes the double assignment case where region in one * location changes the files out from underneath a region being served elsewhere. */ @Test public void testFencingAroundCompaction() throws Exception { for(MemoryCompactionPolicy policy : MemoryCompactionPolicy.values()) { doTest(BlockCompactionsInPrepRegion.class, policy); } }
/** * @param inMemoryCompaction the prefered in-memory compaction policy for * this column family * @return this (for chained invocation) */ public ModifyableColumnFamilyDescriptor setInMemoryCompaction(MemoryCompactionPolicy inMemoryCompaction) { return setValue(IN_MEMORY_COMPACTION_BYTES, inMemoryCompaction.name()); }
if (cmd.startsWith(inMemoryCompaction)) { opts.inMemoryCompaction = MemoryCompactionPolicy.valueOf(cmd.substring(inMemoryCompaction.length())); continue;
/** * Test that puts up a regionserver, starts a compaction on a loaded region but holds the * compaction completion until after we have killed the server and the region has come up on * a new regionserver altogether. This fakes the double assignment case where region in one * location changes the files out from underneath a region being served elsewhere. */ @Test public void testFencingAroundCompactionAfterWALSync() throws Exception { for(MemoryCompactionPolicy policy : MemoryCompactionPolicy.values()) { doTest(BlockCompactionsInCompletionRegion.class, policy); } }
/** * @param inMemoryCompaction the prefered in-memory compaction policy for * this column family * @return this (for chained invocation) */ public ModifyableColumnFamilyDescriptor setInMemoryCompaction(MemoryCompactionPolicy inMemoryCompaction) { return setValue(IN_MEMORY_COMPACTION_BYTES, inMemoryCompaction.name()); }
private HRegion initHRegion(String callingMethod, Configuration conf) throws IOException { int i=0; HTableDescriptor htd = new HTableDescriptor(TABLENAME); for (byte[] family : FAMILIES) { HColumnDescriptor hcd = new HColumnDescriptor(family); // even column families are going to have compacted memstore if(i%2 == 0) { hcd.setInMemoryCompaction(MemoryCompactionPolicy.valueOf( conf.get(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_KEY))); } else { hcd.setInMemoryCompaction(MemoryCompactionPolicy.NONE); } htd.addFamily(hcd); i++; } HRegionInfo info = new HRegionInfo(TABLENAME, null, null, false); Path path = new Path(DIR, callingMethod); return HBaseTestingUtility.createRegionAndWAL(info, path, conf, htd); }
/** * HBASE-12782 ITBLL fails for me if generator does anything but 5M per maptask. * Create a region. Close it. Then copy into place a file to replay, one that is bigger than * configured flush size so we bring on lots of flushes. Then reopen and confirm all edits * made it in. * @throws IOException */ @Test public void testReplayWorksThoughLotsOfFlushing() throws IOException { CacheConfig.instantiateBlockCache(TEST_UTIL.getConfiguration()); for(MemoryCompactionPolicy policy : MemoryCompactionPolicy.values()) { testReplayWorksWithMemoryCompactionPolicy(policy); } }
@Before public void setUp() throws Exception { MemoryCompactionPolicy policy = getMemoryCompactionPolicy(); TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(TABLE_NAME) .setValue(CompactingMemStore.COMPACTING_MEMSTORE_TYPE_KEY, policy.name()); if (policy == MemoryCompactionPolicy.EAGER) { builder.setValue(MemStoreLAB.USEMSLAB_KEY, "false"); builder.setValue(CompactingMemStore.IN_MEMORY_FLUSH_THRESHOLD_FACTOR_KEY, "0.9"); } Stream.of(FAMILIES).map(ColumnFamilyDescriptorBuilder::of) .forEachOrdered(builder::setColumnFamily); UTIL.getAdmin().createTable(builder.build()); tool.setConf(UTIL.getConfiguration()); }
if (cmd.startsWith(inMemoryCompaction)) { opts.inMemoryCompaction = MemoryCompactionPolicy.valueOf(cmd.substring(inMemoryCompaction.length())); continue;