Class TestCatalogJanitor
java.lang.Object
org.apache.hadoop.hbase.master.janitor.TestCatalogJanitor
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static final HBaseTestingUtility
private org.apache.hadoop.hbase.master.janitor.CatalogJanitor
private static final org.slf4j.Logger
private MockMasterServices
final org.junit.rules.TestName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.fs.FileStatus[]
addMockStoreFiles
(int count, org.apache.hadoop.hbase.master.MasterServices services, org.apache.hadoop.fs.Path storedir) static void
private org.apache.hadoop.fs.Path
createMergeReferenceFile
(org.apache.hadoop.fs.Path storeDir, org.apache.hadoop.hbase.HRegionInfo mergedRegion, org.apache.hadoop.hbase.HRegionInfo parentRegion) 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
private void
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
void
void
void
Test clearing a split parent.void
void
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 backupvoid
Make sure last parent with empty end key gets cleaned up even if daughter is cleaned up before it.void
Make sure parent gets cleaned up even if daughter is cleaned up before it.void
CatalogJanitor.scan() should not clean parent regions if their own parents are still referencing them.void
Test that we correctly archive all the storefiles when a region is deleted
-
Field Details
-
CLASS_RULE
-
LOG
-
HTU
-
name
-
masterServices
-
janitor
-
-
Constructor Details
-
TestCatalogJanitor
public TestCatalogJanitor()
-
-
Method Details
-
beforeClass
- Throws:
Exception
-
setup
- Throws:
Exception
-
teardown
-
testCleanMerge
- Throws:
IOException
-
testDontCleanMergeIfFileSystemException
- Throws:
IOException
-
createMergeReferenceFile
private org.apache.hadoop.fs.Path createMergeReferenceFile(org.apache.hadoop.fs.Path storeDir, org.apache.hadoop.hbase.HRegionInfo mergedRegion, org.apache.hadoop.hbase.HRegionInfo parentRegion) throws IOException - Throws:
IOException
-
testCleanParent
Test clearing a split parent.- Throws:
IOException
InterruptedException
-
testParentCleanedEvenIfDaughterGoneFirst
Make sure parent gets cleaned up even if daughter is cleaned up before it.- Throws:
IOException
InterruptedException
-
testLastParentCleanedEvenIfDaughterGoneFirst
Make sure last parent with empty end key gets cleaned up even if daughter is cleaned up before it.- Throws:
IOException
InterruptedException
-
createTableDescriptorForCurrentMethod
- Returns:
- A TableDescriptor with a tableName of current method name and a column family that is MockMasterServices.DEFAULT_COLUMN_FAMILY_NAME)
-
parentWithSpecifiedEndKeyCleanedEvenIfDaughterGoneFirst
private void parentWithSpecifiedEndKeyCleanedEvenIfDaughterGoneFirst(String rootDir, byte[] lastEndKey) throws IOException, InterruptedException Make sure parent with specified end key gets cleaned up even if daughter is cleaned up before it.- Parameters:
rootDir
- the test case name, used as the HBase testing utility rootlastEndKey
- the end key of the split parent- Throws:
IOException
InterruptedException
-
testScanDoesNotCleanRegionsWithExistingParents
CatalogJanitor.scan() should not clean parent regions if their own parents are still referencing them. This ensures that grandparent regions do not point to deleted parent regions.- Throws:
Exception
-
testSplitParentFirstComparator
Test that we correctly archive all the storefiles when a region is deleted -
testArchiveOldRegion
- Throws:
Exception
-
logFiles
- Parameters:
description
- description of the files for loggingstoreFiles
- the status of the files to log
-
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- Throws:
Exception
-
testAlreadyRunningStatus
- Throws:
Exception
-
addMockStoreFiles
private org.apache.hadoop.fs.FileStatus[] addMockStoreFiles(int count, org.apache.hadoop.hbase.master.MasterServices services, org.apache.hadoop.fs.Path storedir) throws IOException - Throws:
IOException
-
setRootDirAndCleanIt
- Throws:
IOException
-
createReferences
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) throws IOException - Throws:
IOException
-
createResult
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) throws IOException - Throws:
IOException
-