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
Exceptionpublic static void tearDownAfterClass() throws Exception
Exceptionpublic void testCompactionSelectAllFilesWeeklyPolicy() throws Exception
Exceptionpublic void testCompactionSelectPartFilesWeeklyPolicy() throws Exception
Exceptionpublic void testCompactionSelectPartFilesWeeklyPolicyWithPastWeek() throws Exception
Exceptionpublic void testCompactionSelectAllFilesWeeklyPolicyWithPastWeek() throws Exception
Exceptionpublic void testCompactionSelectAllFilesMonthlyPolicy() throws Exception
Exceptionpublic void testCompactionSelectNoFilesWithinCurrentWeekMonthlyPolicy() throws Exception
Exceptionpublic void testCompactionSelectPartFilesMonthlyPolicy() throws Exception
Exceptionpublic void testCompactionSelectPartFilesMonthlyPolicyWithPastWeek() throws Exception
Exceptionpublic void testCompactionSelectAllFilesMonthlyPolicyWithPastWeek() throws Exception
Exceptionpublic void testCompactionSelectPartFilesMonthlyPolicyWithPastMonth() throws Exception
Exceptionpublic void testCompactionSelectAllFilesMonthlyPolicyWithPastMonth() throws Exception
Exceptionpublic void testCompactionSelectWithAllFiles() throws Exception
Exceptionpublic void testCompactionSelectWithPartFiles() throws Exception
Exceptionpublic void testCompactionSelectWithForceAllFiles() throws Exception
Exceptionprivate void testCompactionAtMergeSize(String tableName, long mergeSize, org.apache.hadoop.hbase.mob.compactions.MobCompactionRequest.CompactionType type, boolean isForceAllFiles) throws Exception
Exceptionprivate void testCompactionAtMergeSize(String tableName, long mergeSize, org.apache.hadoop.hbase.mob.compactions.MobCompactionRequest.CompactionType type, boolean isForceAllFiles, boolean createDelFiles) throws Exception
Exceptionprivate void testCompactionAtMergeSize(String tableName, long mergeSize, org.apache.hadoop.hbase.mob.compactions.MobCompactionRequest.CompactionType type, boolean isForceAllFiles, boolean createDelFiles, Date date) throws Exception
Exceptionprivate 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
Exceptionpublic void testCompactDelFilesWithDefaultBatchSize() throws Exception
Exceptionpublic void testCompactDelFilesWithSmallBatchSize() throws Exception
Exceptionpublic void testCompactDelFilesChangeMaxDelFileCount() throws Exception
Exceptionpublic void testCompactFilesWithDstDirFull() throws Exception
Exceptionprivate void createMobFile(org.apache.hadoop.fs.Path basePath) throws IOException
IOExceptionprivate void createMobDelFile(org.apache.hadoop.fs.Path basePath, int startKey) throws IOException
IOExceptionpublic void testCompactFilesWithoutDelFile() throws Exception
Exceptionpublic void testCompactFilesWithOneDelFile() throws Exception
Exceptionpublic void testCompactFilesWithMultiDelFiles() throws Exception
Exceptionprivate void testCompactDelFilesAtBatchSize(String tableName, int batchSize, int delfileMaxCount) throws Exception
Exceptionprivate 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 keysIOExceptionprivate 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 selectedIOExceptionprivate void listFiles() throws IOException
IOExceptionprivate 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 fileIOExceptionprivate 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
IOExceptionprivate 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 valueIOExceptionprivate int countDelCellsInDelFiles(List<org.apache.hadoop.fs.Path> paths) throws IOException
paths - the del file pathsIOExceptionprivate static ExecutorService createThreadPool()
private void resetConf()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.