Class TestSnapshotFromMaster
java.lang.Object
org.apache.hadoop.hbase.master.cleaner.TestSnapshotFromMaster
Test the master-related aspects of a snapshot
-
Field Summary
Modifier and TypeFieldDescriptionprivate static org.apache.hadoop.fs.Path
private static final int
private static final long
static final HBaseClassTestRule
private static org.apache.hadoop.fs.FileSystem
private static final org.slf4j.Logger
private static org.apache.hadoop.hbase.master.HMaster
private static final int
private static org.apache.hadoop.fs.Path
private static final org.apache.hadoop.hbase.TableName
private static final byte[]
private static final HBaseTestingUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
private org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription
createSnapshot
(String snapshotName) private org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription
createSnapshotWithTtl
(String snapshotName, long ttl) private static void
Make sure theHFileCleaners
run at least onceprivate final Collection<String>
getHFiles
(org.apache.hadoop.fs.Path dir, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.hbase.TableName tableName) void
setup()
static void
Setup the config for the clusterprivate static void
setupConf
(org.apache.hadoop.conf.Configuration conf) void
tearDown()
void
void
void
void
void
void
Test that the contract from the master for checking on a snapshot are valid.void
void
Test that the snapshot hfile archive cleaner works correctly.
-
Field Details
-
CLASS_RULE
-
LOG
-
UTIL
-
NUM_RS
- See Also:
-
rootDir
-
fs
-
master
-
archiveDir
-
TEST_FAM
-
TABLE_NAME
-
cacheRefreshPeriod
- See Also:
-
blockingStoreFiles
- See Also:
-
-
Constructor Details
-
TestSnapshotFromMaster
public TestSnapshotFromMaster()
-
-
Method Details
-
setupCluster
Setup the config for the cluster- Throws:
Exception
-
setupConf
-
setup
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
cleanupTest
- Throws:
Exception
-
testIsDoneContract
Test that the contract from the master for checking on a snapshot are valid.- If a snapshot fails with an error, we expect to get the source error.
- If there is no snapshot name supplied, we should get an error.
- If asking about a snapshot has hasn't occurred, you should get an error.
- Throws:
Exception
-
testGetCompletedSnapshots
- Throws:
Exception
-
testDeleteSnapshot
- Throws:
Exception
-
testGetCompletedSnapshotsWithCleanup
- Throws:
Exception
-
testGetCompletedSnapshotsWithoutCleanup
- Throws:
Exception
-
testSnapshotCleanupStatus
- Throws:
Exception
-
testSnapshotHFileArchiving
Test that the snapshot hfile archive cleaner works correctly. HFiles that are in snapshots should be retained, while those that are not in a snapshot should be deleted.- Throws:
Exception
- on failure
-
getHFiles
private final Collection<String> getHFiles(org.apache.hadoop.fs.Path dir, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.hbase.TableName tableName) throws IOException - Returns:
- all the HFiles for a given table in the specified dir
- Throws:
IOException
- on expected failure
-
ensureHFileCleanersRun
Make sure theHFileCleaners
run at least once -
createSnapshot
private org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription createSnapshot(String snapshotName) throws IOException - Throws:
IOException
-
createSnapshotWithTtl
private org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription createSnapshotWithTtl(String snapshotName, long ttl) throws IOException - Throws:
IOException
-
testAsyncSnapshotWillNotBlockSnapshotHFileCleaner
- Throws:
Exception
-