public class TestStripeCompactionPolicy extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
TestStripeCompactionPolicy.Scanner |
Modifier and Type | Field and Description |
---|---|
static HBaseClassTestRule |
CLASS_RULE |
private static int |
defaultInitialCount |
private static float |
defaultSplitCount |
private static long |
defaultSplitSize |
private static long |
defaultTtl |
private static byte[] |
KEY_A |
private static byte[] |
KEY_B |
private static byte[] |
KEY_C |
private static byte[] |
KEY_D |
private static byte[] |
KEY_E |
private static org.apache.hadoop.hbase.KeyValue |
KV_A |
private static org.apache.hadoop.hbase.KeyValue |
KV_B |
private static org.apache.hadoop.hbase.KeyValue |
KV_C |
private static org.apache.hadoop.hbase.KeyValue |
KV_D |
private static org.apache.hadoop.hbase.KeyValue |
KV_E |
boolean |
usePrivateReaders |
Constructor and Description |
---|
TestStripeCompactionPolicy() |
Modifier and Type | Method and Description |
---|---|
private static ArrayList<org.apache.hadoop.hbase.regionserver.HStoreFile> |
al(org.apache.hadoop.hbase.regionserver.HStoreFile... sfs) |
private static List<byte[]> |
createBoundaries(int stripeCount) |
private org.apache.hadoop.hbase.regionserver.compactions.StripeCompactor |
createCompactor() |
private static org.apache.hadoop.hbase.regionserver.HStoreFile |
createFile() |
private static org.apache.hadoop.hbase.regionserver.HStoreFile |
createFile(long size) |
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy |
createPolicy(org.apache.hadoop.conf.Configuration conf)
HELPER METHODS
|
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy |
createPolicy(org.apache.hadoop.conf.Configuration conf,
long splitSize,
float splitCount,
int initialCount,
boolean hasTtl) |
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider |
createStripes(int l0Count,
byte[]... boundaries) |
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider |
createStripes(List<byte[]> boundaries,
List<List<Long>> stripeSizes,
List<Long> l0Sizes) |
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider |
createStripesL0Only(int l0Count,
long l0Size) |
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider |
createStripesWithFiles(List<byte[]> boundaries,
List<List<org.apache.hadoop.hbase.regionserver.HStoreFile>> stripeFiles,
List<org.apache.hadoop.hbase.regionserver.HStoreFile> l0Files)
This method actually does all the work.
|
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider |
createStripesWithFiles(List<org.apache.hadoop.hbase.regionserver.HStoreFile>... stripeFiles) |
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider |
createStripesWithSizes(int l0Count,
long l0Size,
List<List<Long>> sizes) |
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider |
createStripesWithSizes(int l0Count,
long l0Size,
Long[]... sizes) |
static Iterable<Object[]> |
data() |
private byte[] |
dropDeletesMatcher(Boolean dropDeletes,
byte[] value) |
private static List<org.apache.hadoop.hbase.regionserver.HStoreFile> |
getAllFiles(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si,
int fromStripe,
int toStripe) |
private static void |
setFileStripe(org.apache.hadoop.hbase.regionserver.HStoreFile sf,
byte[] startKey,
byte[] endKey) |
void |
testExistingStripesFromL0() |
void |
testInitialCountFromL0() |
void |
testMergeExpiredFiles() |
void |
testMergeExpiredStripes() |
void |
testNewStripesFromFlush() |
void |
testNoStripesFromFlush() |
void |
testNothingToCompactFromL0() |
void |
testOldStripesFromFlush() |
void |
testSingleStripeCompaction() |
void |
testSingleStripeDropDeletes() |
void |
testSplitOffStripe() |
void |
testSplitOffStripeDropDeletes() |
void |
testSplitOffStripeOffPeak() |
void |
testWithParallelCompaction() |
void |
testWithReferences() |
private void |
verifyCollectionsEqual(Collection<org.apache.hadoop.hbase.regionserver.HStoreFile> sfs,
Collection<org.apache.hadoop.hbase.regionserver.HStoreFile> scr) |
private void |
verifyCompaction(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy,
org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si,
Collection<org.apache.hadoop.hbase.regionserver.HStoreFile> sfs,
Boolean dropDeletes,
Integer count,
Long size,
byte[] start,
byte[] end,
boolean needsCompaction)
Verify arbitrary compaction.
|
private void |
verifyCompaction(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy,
org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si,
Collection<org.apache.hadoop.hbase.regionserver.HStoreFile> sfs,
byte[] dropDeletesFrom,
byte[] dropDeletesTo,
List<byte[]> boundaries)
Verify arbitrary compaction.
|
protected void |
verifyFlush(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy,
org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si,
org.apache.hadoop.hbase.KeyValue[] input,
org.apache.hadoop.hbase.KeyValue[][] expected,
byte[][] boundaries)
Verify arbitrary flush.
|
private void |
verifyMergeCompatcion(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy,
org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si,
int from,
int to) |
private void |
verifyNoCompaction(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy,
org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si)
Verify no compaction is needed or selected.
|
private void |
verifySingleStripeCompaction(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy,
org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si,
int index,
Boolean dropDeletes) |
private void |
verifyWholeStripesCompaction(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy,
org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si,
int from,
int to,
Boolean dropDeletes,
Integer count,
Long size) |
private void |
verifyWholeStripesCompaction(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy,
org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si,
int from,
int to,
Boolean dropDeletes,
Integer count,
Long size,
boolean needsCompaction)
Verify the compaction that includes several entire stripes.
|
public static final HBaseClassTestRule CLASS_RULE
private static final byte[] KEY_A
private static final byte[] KEY_B
private static final byte[] KEY_C
private static final byte[] KEY_D
private static final byte[] KEY_E
private static final org.apache.hadoop.hbase.KeyValue KV_A
private static final org.apache.hadoop.hbase.KeyValue KV_B
private static final org.apache.hadoop.hbase.KeyValue KV_C
private static final org.apache.hadoop.hbase.KeyValue KV_D
private static final org.apache.hadoop.hbase.KeyValue KV_E
private static long defaultSplitSize
private static float defaultSplitCount
private static final int defaultInitialCount
private static long defaultTtl
public boolean usePrivateReaders
public TestStripeCompactionPolicy()
public void testNoStripesFromFlush() throws Exception
Exception
public void testOldStripesFromFlush() throws Exception
Exception
public void testNewStripesFromFlush() throws Exception
Exception
public void testSingleStripeCompaction() throws Exception
Exception
public void testWithParallelCompaction() throws Exception
Exception
public void testWithReferences() throws Exception
Exception
public void testInitialCountFromL0() throws Exception
Exception
public void testExistingStripesFromL0() throws Exception
Exception
public void testNothingToCompactFromL0() throws Exception
Exception
public void testSplitOffStripe() throws Exception
Exception
public void testSplitOffStripeOffPeak() throws Exception
Exception
public void testSplitOffStripeDropDeletes() throws Exception
Exception
public void testMergeExpiredFiles() throws Exception
Exception
public void testMergeExpiredStripes() throws Exception
Exception
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider createStripesWithFiles(List<org.apache.hadoop.hbase.regionserver.HStoreFile>... stripeFiles) throws Exception
Exception
public void testSingleStripeDropDeletes() throws Exception
Exception
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy createPolicy(org.apache.hadoop.conf.Configuration conf) throws Exception
Exception
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy createPolicy(org.apache.hadoop.conf.Configuration conf, long splitSize, float splitCount, int initialCount, boolean hasTtl) throws Exception
Exception
private static ArrayList<org.apache.hadoop.hbase.regionserver.HStoreFile> al(org.apache.hadoop.hbase.regionserver.HStoreFile... sfs)
private void verifyMergeCompatcion(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy, org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si, int from, int to) throws Exception
Exception
private void verifyWholeStripesCompaction(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy, org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si, int from, int to, Boolean dropDeletes, Integer count, Long size, boolean needsCompaction) throws IOException
policy
- Policy to test.si
- Stripe information pre-set with stripes to test.from
- Starting stripe.to
- Ending stripe (inclusive).dropDeletes
- Whether to drop deletes from compaction range.count
- Expected # of resulting stripes, null if not checked.size
- Expected target stripe size, null if not checked.IOException
private void verifyWholeStripesCompaction(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy, org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si, int from, int to, Boolean dropDeletes, Integer count, Long size) throws IOException
IOException
private void verifySingleStripeCompaction(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy, org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si, int index, Boolean dropDeletes) throws IOException
IOException
private void verifyNoCompaction(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy, org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si) throws IOException
policy
- Policy to test.si
- Stripe information pre-set with stripes to test.IOException
private void verifyCompaction(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy, org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si, Collection<org.apache.hadoop.hbase.regionserver.HStoreFile> sfs, byte[] dropDeletesFrom, byte[] dropDeletesTo, List<byte[]> boundaries) throws Exception
policy
- Policy to test.si
- Stripe information pre-set with stripes to test.sfs
- Files that should be compacted.dropDeletesFrom
- Row from which to drop deletes.dropDeletesTo
- Row to which to drop deletes.boundaries
- Expected target stripe boundaries.Exception
private void verifyCompaction(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy, org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si, Collection<org.apache.hadoop.hbase.regionserver.HStoreFile> sfs, Boolean dropDeletes, Integer count, Long size, byte[] start, byte[] end, boolean needsCompaction) throws IOException
policy
- Policy to test.si
- Stripe information pre-set with stripes to test.sfs
- Files that should be compacted.dropDeletes
- Whether to drop deletes from compaction range.count
- Expected # of resulting stripes, null if not checked.size
- Expected target stripe size, null if not checked.start
- Left boundary of the compaction.end
- Right boundary of the compaction.IOException
protected void verifyFlush(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy policy, org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si, org.apache.hadoop.hbase.KeyValue[] input, org.apache.hadoop.hbase.KeyValue[][] expected, byte[][] boundaries) throws IOException
IOException
private byte[] dropDeletesMatcher(Boolean dropDeletes, byte[] value)
private void verifyCollectionsEqual(Collection<org.apache.hadoop.hbase.regionserver.HStoreFile> sfs, Collection<org.apache.hadoop.hbase.regionserver.HStoreFile> scr)
private static List<org.apache.hadoop.hbase.regionserver.HStoreFile> getAllFiles(org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider si, int fromStripe, int toStripe)
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider createStripes(int l0Count, byte[]... boundaries) throws Exception
l0Count
- Number of L0 files.boundaries
- Target boundaries.Exception
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider createStripesL0Only(int l0Count, long l0Size) throws Exception
l0Count
- Number of L0 files.l0Size
- Size of each file.Exception
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider createStripesWithSizes(int l0Count, long l0Size, Long[]... sizes) throws Exception
l0Count
- Number of L0 files.l0Size
- Size of each file.sizes
- Sizes of the files; each sub-array representing a stripe.Exception
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider createStripesWithSizes(int l0Count, long l0Size, List<List<Long>> sizes) throws Exception
Exception
private static List<byte[]> createBoundaries(int stripeCount)
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider createStripes(List<byte[]> boundaries, List<List<Long>> stripeSizes, List<Long> l0Sizes) throws Exception
Exception
private static org.apache.hadoop.hbase.regionserver.compactions.StripeCompactionPolicy.StripeInformationProvider createStripesWithFiles(List<byte[]> boundaries, List<List<org.apache.hadoop.hbase.regionserver.HStoreFile>> stripeFiles, List<org.apache.hadoop.hbase.regionserver.HStoreFile> l0Files) throws Exception
Exception
private static org.apache.hadoop.hbase.regionserver.HStoreFile createFile(long size) throws Exception
Exception
private static org.apache.hadoop.hbase.regionserver.HStoreFile createFile() throws Exception
Exception
private static void setFileStripe(org.apache.hadoop.hbase.regionserver.HStoreFile sf, byte[] startKey, byte[] endKey)
private org.apache.hadoop.hbase.regionserver.compactions.StripeCompactor createCompactor() throws Exception
Exception
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.