public class TestSnapshotFileCache extends Object
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
TestSnapshotFileCache.SnapshotFiles |
| Modifier and Type | Field and Description |
|---|---|
static HBaseClassTestRule |
CLASS_RULE |
protected static org.apache.hadoop.conf.Configuration |
conf |
protected static org.apache.hadoop.fs.FileSystem |
fs |
protected static org.slf4j.Logger |
LOG |
protected static long |
PERIOD |
protected static org.apache.hadoop.fs.Path |
rootDir |
protected static org.apache.hadoop.fs.Path |
snapshotDir |
protected static HBaseTestingUtility |
UTIL |
protected static org.apache.hadoop.fs.Path |
workingDir |
protected static org.apache.hadoop.fs.FileSystem |
workingFs |
| Constructor and Description |
|---|
TestSnapshotFileCache() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanupFiles() |
private static boolean |
contains(Iterable<org.apache.hadoop.fs.FileStatus> files,
org.apache.hadoop.fs.Path filePath) |
private void |
createAndTestSnapshot(org.apache.hadoop.hbase.master.snapshot.SnapshotFileCache cache,
SnapshotTestingUtils.SnapshotMock.SnapshotBuilder builder,
boolean tmp,
boolean removeOnExit,
boolean setFolderTime) |
private SnapshotTestingUtils.SnapshotMock.SnapshotBuilder |
createAndTestSnapshotV1(org.apache.hadoop.hbase.master.snapshot.SnapshotFileCache cache,
String name,
boolean tmp,
boolean removeOnExit,
boolean setFolderTime) |
private void |
createAndTestSnapshotV2(org.apache.hadoop.hbase.master.snapshot.SnapshotFileCache cache,
String name,
boolean tmp,
boolean removeOnExit,
boolean setFolderTime) |
private static Iterable<org.apache.hadoop.fs.FileStatus> |
getNonSnapshotFiles(org.apache.hadoop.hbase.master.snapshot.SnapshotFileCache cache,
org.apache.hadoop.fs.Path storeFile) |
private List<org.apache.hadoop.fs.FileStatus> |
getStoreFilesForSnapshot(SnapshotTestingUtils.SnapshotMock.SnapshotBuilder builder) |
protected static void |
initCommon() |
private org.apache.hadoop.fs.FileStatus |
mockStoreFile(String storeFileName) |
static void |
startCluster() |
static void |
stopCluster() |
void |
testCacheUpdatedWhenLastModifiedOfSnapDirNotUpdated() |
void |
testLoadAndDelete() |
void |
testReloadModifiedDirectory() |
void |
testSnapshotTempDirReload() |
void |
testWeNeverCacheTmpDirAndLoadIt() |
public static final HBaseClassTestRule CLASS_RULE
protected static final org.slf4j.Logger LOG
protected static final HBaseTestingUtility UTIL
protected static final long PERIOD
protected static org.apache.hadoop.fs.FileSystem fs
protected static org.apache.hadoop.fs.Path rootDir
protected static org.apache.hadoop.fs.Path snapshotDir
protected static org.apache.hadoop.conf.Configuration conf
protected static org.apache.hadoop.fs.FileSystem workingFs
protected static org.apache.hadoop.fs.Path workingDir
public TestSnapshotFileCache()
protected static void initCommon() throws Exception
Exceptionpublic static void startCluster() throws Exception
Exceptionpublic static void stopCluster() throws Exception
Exceptionpublic void cleanupFiles() throws Exception
Exceptionpublic void testLoadAndDelete() throws IOException
IOExceptionpublic void testReloadModifiedDirectory() throws IOException
IOExceptionpublic void testSnapshotTempDirReload() throws IOException
IOExceptionpublic void testCacheUpdatedWhenLastModifiedOfSnapDirNotUpdated() throws IOException
IOExceptionpublic void testWeNeverCacheTmpDirAndLoadIt() throws Exception
Exceptionprivate List<org.apache.hadoop.fs.FileStatus> getStoreFilesForSnapshot(SnapshotTestingUtils.SnapshotMock.SnapshotBuilder builder) throws IOException
IOExceptionprivate org.apache.hadoop.fs.FileStatus mockStoreFile(String storeFileName)
private SnapshotTestingUtils.SnapshotMock.SnapshotBuilder createAndTestSnapshotV1(org.apache.hadoop.hbase.master.snapshot.SnapshotFileCache cache, String name, boolean tmp, boolean removeOnExit, boolean setFolderTime) throws IOException
IOExceptionprivate void createAndTestSnapshotV2(org.apache.hadoop.hbase.master.snapshot.SnapshotFileCache cache, String name, boolean tmp, boolean removeOnExit, boolean setFolderTime) throws IOException
IOExceptionprivate void createAndTestSnapshot(org.apache.hadoop.hbase.master.snapshot.SnapshotFileCache cache, SnapshotTestingUtils.SnapshotMock.SnapshotBuilder builder, boolean tmp, boolean removeOnExit, boolean setFolderTime) throws IOException
IOExceptionprivate static boolean contains(Iterable<org.apache.hadoop.fs.FileStatus> files, org.apache.hadoop.fs.Path filePath)
private static Iterable<org.apache.hadoop.fs.FileStatus> getNonSnapshotFiles(org.apache.hadoop.hbase.master.snapshot.SnapshotFileCache cache, org.apache.hadoop.fs.Path storeFile) throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.