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 n
|
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
Exception
public void setup() throws IOException, org.apache.zookeeper.KeeperException
IOException
org.apache.zookeeper.KeeperException
public void teardown()
public void testCleanParent() throws IOException, InterruptedException
IOException
InterruptedException
public void testParentCleanedEvenIfDaughterGoneFirst() throws IOException, InterruptedException
IOException
InterruptedException
public void testLastParentCleanedEvenIfDaughterGoneFirst() throws IOException, InterruptedException
IOException
InterruptedException
private 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 parentIOException
InterruptedException
public void testScanDoesNotCleanRegionsWithExistingParents() throws Exception
Exception
public void testSplitParentFirstComparator()
public void testArchiveOldRegion() throws Exception
Exception
private 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
Exception
public void testAlreadyRunningStatus() throws Exception
Exception
private org.apache.hadoop.fs.FileStatus[] addMockStoreFiles(int count, org.apache.hadoop.hbase.master.MasterServices services, org.apache.hadoop.fs.Path storedir) throws IOException
IOException
private String setRootDirAndCleanIt(HBaseTestingUtility htu, String subdir) throws IOException
IOException
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
IOException
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
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.