public class HFileArchiveTestingUtil extends Object
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
Modifier | Constructor and Description |
---|---|
private |
HFileArchiveTestingUtil() |
Modifier and Type | Method and Description |
---|---|
private static String |
assertArchiveEquality(List<String> expected,
List<String> archived) |
static void |
assertArchiveEqualToOriginal(org.apache.hadoop.fs.FileStatus[] expected,
org.apache.hadoop.fs.FileStatus[] actual,
org.apache.hadoop.fs.FileSystem fs)
Compare the archived files to the files in the original directory
|
static void |
assertArchiveEqualToOriginal(org.apache.hadoop.fs.FileStatus[] expected,
org.apache.hadoop.fs.FileStatus[] actual,
org.apache.hadoop.fs.FileSystem fs,
boolean hasTimedBackup)
Compare the archived files to the files in the original directory
|
static boolean |
compareArchiveToOriginal(org.apache.hadoop.fs.FileStatus[] previous,
org.apache.hadoop.fs.FileStatus[] archived,
org.apache.hadoop.fs.FileSystem fs,
boolean hasTimedBackup) |
private static String |
compareFileLists(List<String> expected,
List<String> gotten) |
private static List<String> |
convertToString(org.apache.hadoop.fs.FileStatus[] files) |
private static List<String> |
convertToString(List<org.apache.hadoop.fs.FileStatus> files) |
private static List<List<String>> |
getFileLists(org.apache.hadoop.fs.FileStatus[] previous,
org.apache.hadoop.fs.FileStatus[] archived)
Returns <expected, gotten, backup>, where each is sorted
|
static org.apache.hadoop.fs.Path |
getRegionArchiveDir(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.regionserver.HRegion region)
Helper method to get the archive directory for the specified region
|
static org.apache.hadoop.fs.Path |
getStoreArchivePath(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.regionserver.HRegion region,
org.apache.hadoop.hbase.regionserver.Store store)
Helper method to get the store archive directory for the specified region
|
static org.apache.hadoop.fs.Path |
getStoreArchivePath(HBaseTestingUtility util,
String tableName,
byte[] storeName) |
private static final org.slf4j.Logger LOG
private HFileArchiveTestingUtil()
public static boolean compareArchiveToOriginal(org.apache.hadoop.fs.FileStatus[] previous, org.apache.hadoop.fs.FileStatus[] archived, org.apache.hadoop.fs.FileSystem fs, boolean hasTimedBackup)
public static void assertArchiveEqualToOriginal(org.apache.hadoop.fs.FileStatus[] expected, org.apache.hadoop.fs.FileStatus[] actual, org.apache.hadoop.fs.FileSystem fs) throws IOException
expected
- original files that should have been archivedactual
- files that were archivedfs
- filessystem on which the archiving took place nIOException
public static void assertArchiveEqualToOriginal(org.apache.hadoop.fs.FileStatus[] expected, org.apache.hadoop.fs.FileStatus[] actual, org.apache.hadoop.fs.FileSystem fs, boolean hasTimedBackup) throws IOException
expected
- original files that should have been archivedactual
- files that were archivedfs
- FileSystem
on which the archiving took placehasTimedBackup
- true if we expect to find an archive backup directory with a
copy of the files in the archive directory (and the original files). nIOException
private static String assertArchiveEquality(List<String> expected, List<String> archived)
private static List<List<String>> getFileLists(org.apache.hadoop.fs.FileStatus[] previous, org.apache.hadoop.fs.FileStatus[] archived)
private static List<String> convertToString(org.apache.hadoop.fs.FileStatus[] files)
private static List<String> convertToString(List<org.apache.hadoop.fs.FileStatus> files)
public static org.apache.hadoop.fs.Path getRegionArchiveDir(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.regionserver.HRegion region) throws IOException
conf
- Configuration
to check for the name of the archive directoryregion
- region that is being archivedPath
to the archive directory for the given regionIOException
public static org.apache.hadoop.fs.Path getStoreArchivePath(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.regionserver.HRegion region, org.apache.hadoop.hbase.regionserver.Store store) throws IOException
conf
- Configuration
to check for the name of the archive directoryregion
- region that is being archivedstore
- store that is archiving filesPath
to the store archive directory for the given regionIOException
public static org.apache.hadoop.fs.Path getStoreArchivePath(HBaseTestingUtility util, String tableName, byte[] storeName) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.