Class TestSnapshotFromMaster
java.lang.Object
org.apache.hadoop.hbase.master.cleaner.TestSnapshotFromMaster
Test the master-related aspects of a snapshot
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static org.apache.hadoop.fs.Pathprivate static final intprivate static final longstatic final HBaseClassTestRuleprivate static org.apache.hadoop.fs.FileSystemprivate static final org.slf4j.Loggerprivate static org.apache.hadoop.hbase.master.HMasterprivate static final intprivate static org.apache.hadoop.fs.Pathprivate static final org.apache.hadoop.hbase.TableNameprivate static final byte[]private static final HBaseTestingUtility -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidprivate org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescriptioncreateSnapshot(String snapshotName) private org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescriptioncreateSnapshotWithTtl(String snapshotName, long ttl) private static voidMake sure theHFileCleanersrun 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) voidsetup()static voidSetup the config for the clusterprivate static voidsetupConf(org.apache.hadoop.conf.Configuration conf) voidtearDown()voidvoidvoidvoidvoidvoidTest that the contract from the master for checking on a snapshot are valid.voidvoidTest 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 theHFileCleanersrun 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
-