public class TestHFileArchiving extends Object
HFileArchiver correctly removes all the parts of a region when cleaning up
a region| Modifier and Type | Class and Description |
|---|---|
private static interface |
TestHFileArchiving.ArchivingFunction<Configuration,FS,Region,Dir,Family,Files> |
| Modifier and Type | Field and Description |
|---|---|
static HBaseClassTestRule |
CLASS_RULE |
private static org.slf4j.Logger |
LOG |
org.junit.rules.TestName |
name |
private static org.apache.hadoop.hbase.master.cleaner.DirScanPool |
POOL |
private static byte[] |
TEST_FAM |
private static HBaseTestingUtility |
UTIL |
| Constructor and Description |
|---|
TestHFileArchiving() |
| Modifier and Type | Method and Description |
|---|---|
private void |
assertArchiveFiles(org.apache.hadoop.fs.FileSystem fs,
List<String> storeFiles,
long timeout) |
static void |
cleanupTest() |
private void |
clearArchiveDirectory() |
private List<String> |
getAllFileNames(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path archiveDir)
Get the names of all the files below the given directory
|
private List<org.apache.hadoop.hbase.regionserver.HRegion> |
initTableForArchivingRegions(org.apache.hadoop.hbase.TableName tableName) |
private List<String> |
recurseOnFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus[] files,
List<String> fileNames)
Recursively lookup all the file names under the file[] array
|
static void |
setupCluster()
Setup the config for the cluster
|
private static void |
setupConf(org.apache.hadoop.conf.Configuration conf) |
void |
tearDown() |
void |
testArchiveOnTableDelete() |
void |
testArchiveOnTableFamilyDelete()
Test that the store files are archived when a column family is removed.
|
void |
testArchiveRecoveredEditsWalDirDifferentFS() |
void |
testArchiveRecoveredEditsWalDirNull() |
private void |
testArchiveRecoveredEditsWalDirNullOrSame(String walDir) |
void |
testArchiveRecoveredEditsWalDirSameFsStoreFiles() |
void |
testArchiveRecoveredEditsWrongFS() |
void |
testArchiveRegions() |
void |
testArchiveRegionsWhenPermissionDenied() |
void |
testArchiveRegionTableAndRegionDirsNull() |
void |
testArchiveRegionWithRegionDirNull() |
void |
testArchiveRegionWithTableDirNull() |
private void |
testArchiveStoreFilesDifferentFileSystems(String walDir,
String expectedBase,
TestHFileArchiving.ArchivingFunction<org.apache.hadoop.conf.Configuration,org.apache.hadoop.fs.FileSystem,org.apache.hadoop.hbase.client.RegionInfo,org.apache.hadoop.fs.Path,byte[],Collection<org.apache.hadoop.hbase.regionserver.HStoreFile>> archivingFunction) |
void |
testArchiveStoreFilesDifferentFileSystemsWallAndRootSame() |
void |
testArchiveStoreFilesDifferentFileSystemsWallNullPlainRoot() |
void |
testArchiveStoreFilesDifferentFileSystemsWallWithSchemaPlainRoot() |
void |
testCleaningRace()
Test HFileArchiver.resolveAndArchive() race condition HBASE-7643
|
void |
testDeleteRegionWithNoStoreFiles()
Test that the region directory is removed when we archive a region without store files, but
still has hidden files.
|
void |
testRemoveRegionDirOnArchive() |
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static final HBaseTestingUtility UTIL
private static final byte[] TEST_FAM
private static org.apache.hadoop.hbase.master.cleaner.DirScanPool POOL
public org.junit.rules.TestName name
public TestHFileArchiving()
public static void setupCluster() throws Exception
Exceptionprivate static void setupConf(org.apache.hadoop.conf.Configuration conf)
public static void cleanupTest() throws Exception
Exceptionpublic void testArchiveStoreFilesDifferentFileSystemsWallWithSchemaPlainRoot() throws Exception
Exceptionpublic void testArchiveStoreFilesDifferentFileSystemsWallNullPlainRoot() throws Exception
Exceptionpublic void testArchiveStoreFilesDifferentFileSystemsWallAndRootSame() throws Exception
Exceptionprivate void testArchiveStoreFilesDifferentFileSystems(String walDir, String expectedBase, TestHFileArchiving.ArchivingFunction<org.apache.hadoop.conf.Configuration,org.apache.hadoop.fs.FileSystem,org.apache.hadoop.hbase.client.RegionInfo,org.apache.hadoop.fs.Path,byte[],Collection<org.apache.hadoop.hbase.regionserver.HStoreFile>> archivingFunction) throws IOException
IOExceptionpublic void testArchiveRecoveredEditsWalDirNull() throws Exception
Exceptionpublic void testArchiveRecoveredEditsWalDirSameFsStoreFiles() throws Exception
Exceptionprivate void testArchiveRecoveredEditsWalDirNullOrSame(String walDir) throws Exception
Exceptionpublic void testArchiveRecoveredEditsWrongFS() throws Exception
Exceptionpublic void testArchiveRecoveredEditsWalDirDifferentFS() throws Exception
Exceptionpublic void testRemoveRegionDirOnArchive() throws Exception
Exceptionpublic void testDeleteRegionWithNoStoreFiles() throws Exception
Exceptionprivate List<org.apache.hadoop.hbase.regionserver.HRegion> initTableForArchivingRegions(org.apache.hadoop.hbase.TableName tableName) throws IOException
IOExceptionpublic void testArchiveRegions() throws Exception
Exceptionpublic void testArchiveRegionsWhenPermissionDenied() throws Exception
Exceptionpublic void testArchiveOnTableDelete() throws Exception
Exceptionprivate void assertArchiveFiles(org.apache.hadoop.fs.FileSystem fs, List<String> storeFiles, long timeout) throws IOException
IOExceptionpublic void testArchiveOnTableFamilyDelete() throws Exception
Exceptionpublic void testCleaningRace() throws Exception
Exceptionpublic void testArchiveRegionTableAndRegionDirsNull() throws IOException
IOExceptionpublic void testArchiveRegionWithTableDirNull() throws IOException
IOExceptionpublic void testArchiveRegionWithRegionDirNull() throws IOException
IOExceptionprivate void clearArchiveDirectory() throws IOException
IOExceptionprivate List<String> getAllFileNames(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path archiveDir) throws IOException
fs - the file system to inspectarchiveDir - the directory in which to lookIOExceptionprivate List<String> recurseOnFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.FileStatus[] files, List<String> fileNames) throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.