public class TestHFileArchiving extends Object
HFileArchiver
correctly removes all the parts of a region when cleaning up
a regionModifier 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,
boolean archiveFileExists,
boolean sourceFileExists,
boolean archiveFileDifferentLength,
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) |
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 |
testArchiveStoreFilesDifferentFileSystemsArchiveFileMatchCurrent() |
void |
testArchiveStoreFilesDifferentFileSystemsArchiveFileMismatch() |
void |
testArchiveStoreFilesDifferentFileSystemsFileAlreadyArchived() |
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
Exception
private static void setupConf(org.apache.hadoop.conf.Configuration conf)
public static void cleanupTest() throws Exception
Exception
public void testArchiveStoreFilesDifferentFileSystemsWallWithSchemaPlainRoot() throws Exception
Exception
public void testArchiveStoreFilesDifferentFileSystemsWallNullPlainRoot() throws Exception
Exception
public void testArchiveStoreFilesDifferentFileSystemsWallAndRootSame() throws Exception
Exception
public void testArchiveStoreFilesDifferentFileSystemsFileAlreadyArchived() throws Exception
Exception
public void testArchiveStoreFilesDifferentFileSystemsArchiveFileMatchCurrent() throws Exception
Exception
public void testArchiveStoreFilesDifferentFileSystemsArchiveFileMismatch() throws Exception
Exception
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) throws IOException
IOException
private void testArchiveStoreFilesDifferentFileSystems(String walDir, String expectedBase, boolean archiveFileExists, boolean sourceFileExists, boolean archiveFileDifferentLength, 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
IOException
public void testArchiveRecoveredEditsWalDirNull() throws Exception
Exception
public void testArchiveRecoveredEditsWalDirSameFsStoreFiles() throws Exception
Exception
private void testArchiveRecoveredEditsWalDirNullOrSame(String walDir) throws Exception
Exception
public void testArchiveRecoveredEditsWrongFS() throws Exception
Exception
public void testArchiveRecoveredEditsWalDirDifferentFS() throws Exception
Exception
public void testRemoveRegionDirOnArchive() throws Exception
Exception
public void testDeleteRegionWithNoStoreFiles() throws Exception
Exception
private List<org.apache.hadoop.hbase.regionserver.HRegion> initTableForArchivingRegions(org.apache.hadoop.hbase.TableName tableName) throws IOException
IOException
public void testArchiveRegions() throws Exception
Exception
public void testArchiveRegionsWhenPermissionDenied() throws Exception
Exception
public void testArchiveOnTableDelete() throws Exception
Exception
private void assertArchiveFiles(org.apache.hadoop.fs.FileSystem fs, List<String> storeFiles, long timeout) throws IOException
IOException
public void testArchiveOnTableFamilyDelete() throws Exception
Exception
public void testCleaningRace() throws Exception
Exception
public void testArchiveRegionTableAndRegionDirsNull() throws IOException
IOException
public void testArchiveRegionWithTableDirNull() throws IOException
IOException
public void testArchiveRegionWithRegionDirNull() throws IOException
IOException
private void clearArchiveDirectory() throws IOException
IOException
private 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 lookIOException
private List<String> recurseOnFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.FileStatus[] files, List<String> fileNames) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.