public class TestPartitionedMobCompactor extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
TestPartitionedMobCompactor.FaultyDistributedFileSystem
The customized Distributed File System Implementation
|
(package private) static class |
TestPartitionedMobCompactor.MyPartitionedMobCompactor |
Modifier and Type | Field and Description |
---|---|
private List<org.apache.hadoop.fs.FileStatus> |
allFiles |
private org.apache.hadoop.fs.Path |
basePath |
private org.apache.hadoop.hbase.io.hfile.CacheConfig |
cacheConf |
static HBaseClassTestRule |
CLASS_RULE |
private org.apache.hadoop.conf.Configuration |
conf |
private long |
DAY_IN_MS |
private List<org.apache.hadoop.fs.Path> |
delFiles |
private String |
delSuffix |
private static String |
family |
private org.apache.hadoop.fs.FileSystem |
fs |
private org.apache.hadoop.hbase.HColumnDescriptor |
hcd |
private static byte[] |
KEYS |
private static org.slf4j.Logger |
LOG |
private List<org.apache.hadoop.fs.FileStatus> |
mobFiles |
private String |
mobSuffix |
org.junit.rules.TestName |
name |
private static ExecutorService |
pool |
private static String |
qf |
private static HBaseTestingUtility |
TEST_UTIL |
Constructor and Description |
---|
TestPartitionedMobCompactor() |
Modifier and Type | Method and Description |
---|---|
private void |
compareCompactedPartitions(List<String> expected,
Collection<org.apache.hadoop.hbase.mob.compactions.PartitionedMobCompactionRequest.CompactionPartition> partitions)
Compares the compacted partitions.
|
private void |
compareDelFiles(List<org.apache.hadoop.hbase.mob.compactions.PartitionedMobCompactionRequest.CompactionDelPartition> delPartitions)
Compares the del files.
|
private int |
countDelCellsInDelFiles(List<org.apache.hadoop.fs.Path> paths)
Gets the number of del cell in the del files
|
private void |
createMobDelFile(org.apache.hadoop.fs.Path basePath,
int startKey)
Create mulitple partition delete files
|
private void |
createMobFile(org.apache.hadoop.fs.Path basePath)
Create mulitple partition files
|
private void |
createStoreFiles(org.apache.hadoop.fs.Path basePath,
String family,
String qualifier,
int count,
org.apache.hadoop.hbase.KeyValue.Type type,
boolean sameStartKey,
Date date) |
private void |
createStoreFiles(org.apache.hadoop.fs.Path basePath,
String family,
String qualifier,
int count,
org.apache.hadoop.hbase.KeyValue.Type type,
Date date)
Creates store files.
|
private static ExecutorService |
createThreadPool() |
private void |
init(String tableName) |
private void |
listFiles()
Lists the files in the path
|
private void |
resetConf()
Resets the configuration.
|
static void |
setUpBeforeClass() |
static void |
tearDownAfterClass() |
private void |
testCompactDelFiles(String tableName,
int expectedFileCount,
int expectedCellCount,
boolean isForceAllFiles)
Tests the compacteDelFile
|
private void |
testCompactDelFilesAtBatchSize(String tableName,
int batchSize,
int delfileMaxCount) |
void |
testCompactDelFilesChangeMaxDelFileCount() |
void |
testCompactDelFilesWithDefaultBatchSize() |
void |
testCompactDelFilesWithSmallBatchSize() |
void |
testCompactFilesWithDstDirFull() |
void |
testCompactFilesWithMultiDelFiles() |
void |
testCompactFilesWithOneDelFile() |
void |
testCompactFilesWithoutDelFile() |
private void |
testCompactionAtMergeSize(String tableName,
long mergeSize,
org.apache.hadoop.hbase.mob.compactions.MobCompactionRequest.CompactionType type,
boolean isForceAllFiles) |
private void |
testCompactionAtMergeSize(String tableName,
long mergeSize,
org.apache.hadoop.hbase.mob.compactions.MobCompactionRequest.CompactionType type,
boolean isForceAllFiles,
boolean createDelFiles) |
private void |
testCompactionAtMergeSize(String tableName,
long mergeSize,
org.apache.hadoop.hbase.mob.compactions.MobCompactionRequest.CompactionType type,
boolean isForceAllFiles,
boolean createDelFiles,
Date date) |
private void |
testCompactionAtMergeSize(String tableName,
long mergeSize,
org.apache.hadoop.hbase.mob.compactions.MobCompactionRequest.CompactionType type,
boolean isForceAllFiles,
boolean createDelFiles,
Date date,
org.apache.hadoop.hbase.client.MobCompactPartitionPolicy policy,
long mergeSizeMultiFactor) |
void |
testCompactionSelectAllFilesMonthlyPolicy() |
void |
testCompactionSelectAllFilesMonthlyPolicyWithPastMonth() |
void |
testCompactionSelectAllFilesMonthlyPolicyWithPastWeek() |
void |
testCompactionSelectAllFilesWeeklyPolicy() |
void |
testCompactionSelectAllFilesWeeklyPolicyWithPastWeek() |
void |
testCompactionSelectNoFilesWithinCurrentWeekMonthlyPolicy() |
void |
testCompactionSelectPartFilesMonthlyPolicy() |
void |
testCompactionSelectPartFilesMonthlyPolicyWithPastMonth() |
void |
testCompactionSelectPartFilesMonthlyPolicyWithPastWeek() |
void |
testCompactionSelectPartFilesWeeklyPolicy() |
void |
testCompactionSelectPartFilesWeeklyPolicyWithPastWeek() |
void |
testCompactionSelectWithAllFiles() |
void |
testCompactionSelectWithForceAllFiles() |
void |
testCompactionSelectWithPartFiles() |
private void |
testSelectFiles(String tableName,
org.apache.hadoop.hbase.mob.compactions.MobCompactionRequest.CompactionType type,
boolean isForceAllFiles,
List<String> expected)
Tests the selectFiles
|
private static void |
writeStoreFile(org.apache.hadoop.hbase.regionserver.StoreFileWriter writer,
byte[] row,
byte[] family,
byte[] qualifier,
org.apache.hadoop.hbase.KeyValue.Type type,
int size)
Writes data to store file.
|
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static final HBaseTestingUtility TEST_UTIL
private static final String family
private static final String qf
private final long DAY_IN_MS
private static byte[] KEYS
private org.apache.hadoop.hbase.HColumnDescriptor hcd
private org.apache.hadoop.conf.Configuration conf
private org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConf
private org.apache.hadoop.fs.FileSystem fs
private org.apache.hadoop.fs.Path basePath
private static ExecutorService pool
public org.junit.rules.TestName name
public TestPartitionedMobCompactor()
public static void setUpBeforeClass() throws Exception
Exception
public static void tearDownAfterClass() throws Exception
Exception
public void testCompactionSelectAllFilesWeeklyPolicy() throws Exception
Exception
public void testCompactionSelectPartFilesWeeklyPolicy() throws Exception
Exception
public void testCompactionSelectPartFilesWeeklyPolicyWithPastWeek() throws Exception
Exception
public void testCompactionSelectAllFilesWeeklyPolicyWithPastWeek() throws Exception
Exception
public void testCompactionSelectAllFilesMonthlyPolicy() throws Exception
Exception
public void testCompactionSelectNoFilesWithinCurrentWeekMonthlyPolicy() throws Exception
Exception
public void testCompactionSelectPartFilesMonthlyPolicy() throws Exception
Exception
public void testCompactionSelectPartFilesMonthlyPolicyWithPastWeek() throws Exception
Exception
public void testCompactionSelectAllFilesMonthlyPolicyWithPastWeek() throws Exception
Exception
public void testCompactionSelectPartFilesMonthlyPolicyWithPastMonth() throws Exception
Exception
public void testCompactionSelectAllFilesMonthlyPolicyWithPastMonth() throws Exception
Exception
public void testCompactionSelectWithAllFiles() throws Exception
Exception
public void testCompactionSelectWithPartFiles() throws Exception
Exception
public void testCompactionSelectWithForceAllFiles() throws Exception
Exception
private void testCompactionAtMergeSize(String tableName, long mergeSize, org.apache.hadoop.hbase.mob.compactions.MobCompactionRequest.CompactionType type, boolean isForceAllFiles) throws Exception
Exception
private void testCompactionAtMergeSize(String tableName, long mergeSize, org.apache.hadoop.hbase.mob.compactions.MobCompactionRequest.CompactionType type, boolean isForceAllFiles, boolean createDelFiles) throws Exception
Exception
private void testCompactionAtMergeSize(String tableName, long mergeSize, org.apache.hadoop.hbase.mob.compactions.MobCompactionRequest.CompactionType type, boolean isForceAllFiles, boolean createDelFiles, Date date) throws Exception
Exception
private void testCompactionAtMergeSize(String tableName, long mergeSize, org.apache.hadoop.hbase.mob.compactions.MobCompactionRequest.CompactionType type, boolean isForceAllFiles, boolean createDelFiles, Date date, org.apache.hadoop.hbase.client.MobCompactPartitionPolicy policy, long mergeSizeMultiFactor) throws Exception
Exception
public void testCompactDelFilesWithDefaultBatchSize() throws Exception
Exception
public void testCompactDelFilesWithSmallBatchSize() throws Exception
Exception
public void testCompactDelFilesChangeMaxDelFileCount() throws Exception
Exception
public void testCompactFilesWithDstDirFull() throws Exception
Exception
private void createMobFile(org.apache.hadoop.fs.Path basePath) throws IOException
IOException
private void createMobDelFile(org.apache.hadoop.fs.Path basePath, int startKey) throws IOException
IOException
public void testCompactFilesWithoutDelFile() throws Exception
Exception
public void testCompactFilesWithOneDelFile() throws Exception
Exception
public void testCompactFilesWithMultiDelFiles() throws Exception
Exception
private void testCompactDelFilesAtBatchSize(String tableName, int batchSize, int delfileMaxCount) throws Exception
Exception
private void testSelectFiles(String tableName, org.apache.hadoop.hbase.mob.compactions.MobCompactionRequest.CompactionType type, boolean isForceAllFiles, List<String> expected) throws IOException
tableName
- the table nametype
- the expected compaction typeisForceAllFiles
- whether all the mob files are selectedexpected
- the expected start keysIOException
private void testCompactDelFiles(String tableName, int expectedFileCount, int expectedCellCount, boolean isForceAllFiles) throws IOException
tableName
- the table nameexpectedFileCount
- the expected file countexpectedCellCount
- the expected cell countisForceAllFiles
- whether all the mob files are selectedIOException
private void listFiles() throws IOException
IOException
private void compareCompactedPartitions(List<String> expected, Collection<org.apache.hadoop.hbase.mob.compactions.PartitionedMobCompactionRequest.CompactionPartition> partitions)
partitions
- the collection of CompactedPartitionsprivate void compareDelFiles(List<org.apache.hadoop.hbase.mob.compactions.PartitionedMobCompactionRequest.CompactionDelPartition> delPartitions)
delPartitions
- all del partitionsprivate void createStoreFiles(org.apache.hadoop.fs.Path basePath, String family, String qualifier, int count, org.apache.hadoop.hbase.KeyValue.Type type, Date date) throws IOException
basePath
- the path to create fileIOException
private void createStoreFiles(org.apache.hadoop.fs.Path basePath, String family, String qualifier, int count, org.apache.hadoop.hbase.KeyValue.Type type, boolean sameStartKey, Date date) throws IOException
IOException
private static void writeStoreFile(org.apache.hadoop.hbase.regionserver.StoreFileWriter writer, byte[] row, byte[] family, byte[] qualifier, org.apache.hadoop.hbase.KeyValue.Type type, int size) throws IOException
writer
- the store file writerrow
- the row keyfamily
- the family namequalifier
- the column qualifiertype
- the key typesize
- the size of valueIOException
private int countDelCellsInDelFiles(List<org.apache.hadoop.fs.Path> paths) throws IOException
paths
- the del file pathsIOException
private static ExecutorService createThreadPool()
private void resetConf()
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.