public class TestCatalogJanitor extends Object
| Modifier and Type | Field and Description |
|---|---|
static HBaseClassTestRule |
CLASS_RULE |
private static HBaseTestingUtility |
HTU |
private org.apache.hadoop.hbase.master.janitor.CatalogJanitor |
janitor |
private static org.slf4j.Logger |
LOG |
private MockMasterServices |
masterServices |
org.junit.rules.TestName |
name |
| Constructor and Description |
|---|
TestCatalogJanitor() |
| Modifier and Type | Method and Description |
|---|---|
private org.apache.hadoop.fs.FileStatus[] |
addMockStoreFiles(int count,
org.apache.hadoop.hbase.master.MasterServices services,
org.apache.hadoop.fs.Path storedir) |
static void |
beforeClass() |
private org.apache.hadoop.fs.Path |
createReferences(org.apache.hadoop.hbase.master.MasterServices services,
org.apache.hadoop.hbase.client.TableDescriptor td,
org.apache.hadoop.hbase.HRegionInfo parent,
org.apache.hadoop.hbase.HRegionInfo daughter,
byte[] midkey,
boolean top) |
private org.apache.hadoop.hbase.client.Result |
createResult(org.apache.hadoop.hbase.HRegionInfo parent,
org.apache.hadoop.hbase.HRegionInfo a,
org.apache.hadoop.hbase.HRegionInfo b) |
private org.apache.hadoop.hbase.client.TableDescriptor |
createTableDescriptorForCurrentMethod() |
private void |
logFiles(String description,
org.apache.hadoop.fs.FileStatus[] storeFiles) |
private void |
parentWithSpecifiedEndKeyCleanedEvenIfDaughterGoneFirst(String rootDir,
byte[] lastEndKey)
Make sure parent with specified end key gets cleaned up even if daughter is cleaned up before it.
|
private String |
setRootDirAndCleanIt(HBaseTestingUtility htu,
String subdir) |
void |
setup() |
void |
teardown() |
void |
testAlreadyRunningStatus() |
void |
testArchiveOldRegion() |
void |
testCleanParent()
Test clearing a split parent.
|
void |
testDuplicateHFileResolution()
Test that if a store file with the same name is present as those already backed up cause the
already archived files to be timestamped backup
|
void |
testLastParentCleanedEvenIfDaughterGoneFirst()
Make sure last parent with empty end key gets cleaned up even if daughter is cleaned up before it.
|
void |
testParentCleanedEvenIfDaughterGoneFirst()
Make sure parent gets cleaned up even if daughter is cleaned up before it.
|
void |
testScanDoesNotCleanRegionsWithExistingParents()
CatalogJanitor.scan() should not clean parent regions if their own
parents are still referencing them.
|
void |
testSplitParentFirstComparator()
Test that we correctly archive all the storefiles when a region is deleted
|
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static final HBaseTestingUtility HTU
public final org.junit.rules.TestName name
private MockMasterServices masterServices
private org.apache.hadoop.hbase.master.janitor.CatalogJanitor janitor
public TestCatalogJanitor()
public static void beforeClass() throws Exception
Exceptionpublic void setup() throws IOException, org.apache.zookeeper.KeeperException
IOExceptionorg.apache.zookeeper.KeeperExceptionpublic void teardown()
public void testCleanParent() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void testParentCleanedEvenIfDaughterGoneFirst() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void testLastParentCleanedEvenIfDaughterGoneFirst() throws IOException, InterruptedException
IOExceptionInterruptedExceptionprivate org.apache.hadoop.hbase.client.TableDescriptor createTableDescriptorForCurrentMethod()
private void parentWithSpecifiedEndKeyCleanedEvenIfDaughterGoneFirst(String rootDir, byte[] lastEndKey) throws IOException, InterruptedException
rootDir - the test case name, used as the HBase testing utility rootlastEndKey - the end key of the split parentIOExceptionInterruptedExceptionpublic void testScanDoesNotCleanRegionsWithExistingParents() throws Exception
Exceptionpublic void testSplitParentFirstComparator()
Exceptionpublic void testArchiveOldRegion() throws Exception
Exceptionprivate void logFiles(String description, org.apache.hadoop.fs.FileStatus[] storeFiles)
description - description of the files for loggingstoreFiles - the status of the files to logpublic void testDuplicateHFileResolution() throws Exception
Exceptionpublic void testAlreadyRunningStatus() throws Exception
Exceptionprivate org.apache.hadoop.fs.FileStatus[] addMockStoreFiles(int count, org.apache.hadoop.hbase.master.MasterServices services, org.apache.hadoop.fs.Path storedir) throws IOException
IOExceptionprivate String setRootDirAndCleanIt(HBaseTestingUtility htu, String subdir) throws IOException
IOExceptionprivate org.apache.hadoop.fs.Path createReferences(org.apache.hadoop.hbase.master.MasterServices services, org.apache.hadoop.hbase.client.TableDescriptor td, org.apache.hadoop.hbase.HRegionInfo parent, org.apache.hadoop.hbase.HRegionInfo daughter, byte[] midkey, boolean top) throws IOException
IOExceptionprivate org.apache.hadoop.hbase.client.Result createResult(org.apache.hadoop.hbase.HRegionInfo parent, org.apache.hadoop.hbase.HRegionInfo a, org.apache.hadoop.hbase.HRegionInfo b) throws IOException
IOExceptionCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.