Search in sources :

Example 6 with StripeInformationProvider

use of org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider in project hbase by apache.

the class TestStripeCompactionPolicy method testNoStripesFromFlush.

@Test
public void testNoStripesFromFlush() throws Exception {
    Configuration conf = HBaseConfiguration.create();
    conf.setBoolean(StripeStoreConfig.FLUSH_TO_L0_KEY, true);
    StripeCompactionPolicy policy = createPolicy(conf);
    StripeInformationProvider si = createStripesL0Only(0, 0);
    KeyValue[] input = new KeyValue[] { KV_A, KV_B, KV_C, KV_D, KV_E };
    KeyValue[][] expected = new KeyValue[][] { input };
    verifyFlush(policy, si, input, expected, null);
}
Also used : KeyValue(org.apache.hadoop.hbase.KeyValue) Configuration(org.apache.hadoop.conf.Configuration) HBaseConfiguration(org.apache.hadoop.hbase.HBaseConfiguration) StripeInformationProvider(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider) Test(org.junit.Test)

Example 7 with StripeInformationProvider

use of org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider in project hbase by apache.

the class TestStripeCompactionPolicy method testOldStripesFromFlush.

@Test
public void testOldStripesFromFlush() throws Exception {
    StripeCompactionPolicy policy = createPolicy(HBaseConfiguration.create());
    StripeInformationProvider si = createStripes(0, KEY_C, KEY_D);
    KeyValue[] input = new KeyValue[] { KV_B, KV_C, KV_C, KV_D, KV_E };
    KeyValue[][] expected = new KeyValue[][] { new KeyValue[] { KV_B }, new KeyValue[] { KV_C, KV_C }, new KeyValue[] { KV_D, KV_E } };
    verifyFlush(policy, si, input, expected, new byte[][] { OPEN_KEY, KEY_C, KEY_D, OPEN_KEY });
}
Also used : KeyValue(org.apache.hadoop.hbase.KeyValue) StripeInformationProvider(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider) Test(org.junit.Test)

Aggregations

StripeInformationProvider (org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider)7 Test (org.junit.Test)6 StoreFile (org.apache.hadoop.hbase.regionserver.StoreFile)4 ArrayList (java.util.ArrayList)3 Configuration (org.apache.hadoop.conf.Configuration)3 HBaseConfiguration (org.apache.hadoop.hbase.HBaseConfiguration)3 KeyValue (org.apache.hadoop.hbase.KeyValue)3 ImmutableList (com.google.common.collect.ImmutableList)2 ConcatenatedLists (org.apache.hadoop.hbase.util.ConcatenatedLists)2 Matchers.anyLong (org.mockito.Matchers.anyLong)2 List (java.util.List)1 StoreConfigInformation (org.apache.hadoop.hbase.regionserver.StoreConfigInformation)1 StripeStoreConfig (org.apache.hadoop.hbase.regionserver.StripeStoreConfig)1 NoLimitThroughputController (org.apache.hadoop.hbase.regionserver.throttle.NoLimitThroughputController)1 User (org.apache.hadoop.hbase.security.User)1