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
Exception
public static void startCluster() throws Exception
Exception
public static void stopCluster() throws Exception
Exception
public void cleanupFiles() throws Exception
Exception
public void testLoadAndDelete() throws IOException
IOException
public void testReloadModifiedDirectory() throws IOException
IOException
public void testSnapshotTempDirReload() throws IOException
IOException
public void testCacheUpdatedWhenLastModifiedOfSnapDirNotUpdated() throws IOException
IOException
public void testWeNeverCacheTmpDirAndLoadIt() throws Exception
Exception
private List<org.apache.hadoop.fs.FileStatus> getStoreFilesForSnapshot(SnapshotTestingUtils.SnapshotMock.SnapshotBuilder builder) throws IOException
IOException
private 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
IOException
private void createAndTestSnapshotV2(org.apache.hadoop.hbase.master.snapshot.SnapshotFileCache cache, String name, boolean tmp, boolean removeOnExit, boolean setFolderTime) throws IOException
IOException
private void createAndTestSnapshot(org.apache.hadoop.hbase.master.snapshot.SnapshotFileCache cache, SnapshotTestingUtils.SnapshotMock.SnapshotBuilder builder, boolean tmp, boolean removeOnExit, boolean setFolderTime) throws IOException
IOException
private 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
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.