Package org.apache.hadoop.hbase.backup
Class TestPointInTimeRestore
java.lang.Object
org.apache.hadoop.hbase.backup.TestBackupBase
org.apache.hadoop.hbase.backup.TestPointInTimeRestore
@Tag("org.apache.hadoop.hbase.testclassification.LargeTests")
public class TestPointInTimeRestore
extends TestBackupBase
Integration-style tests for Point-in-Time Restore (PITR).
These tests exercise the full backup / continuous backup / restore flow: - create backups at
multiple historical points in time (via BackupDriver) - exercise WAL-based
replication/continuous backup - validate Point-in-Time Restore behavior (successful restores,
failure cases)
NOTE: Some tests also create HFiles and perform HBase bulk-loads (HFile -> table) so the restore flow is validated when bulk-loaded storefiles are present in WALs. This ensures the BulkLoadCollector/BulkFilesCollector logic (discovering bulk-loaded store files referenced from WAL bulk-load descriptors) is exercised by the test suite.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.backup.TestBackupBase
TestBackupBase.FullTableBackupClientForTest, TestBackupBase.IncrementalTableBackupClientForTest -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static org.apache.hadoop.fs.Pathprivate static final String(package private) static org.apache.hadoop.fs.FileSystemFields inherited from class org.apache.hadoop.hbase.backup.TestBackupBase
autoRestoreOnFailure, BACKUP_REMOTE_ROOT_DIR, BACKUP_ROOT_DIR, conf1, conf2, famName, NB_ROWS_IN_BATCH, provider, qualName, secure, table1, table1_restore, table1Desc, table2, table2_restore, table3, table3_restore, table4, TEST_UTIL, TEST_UTIL2, useSecondCluster -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidprivate static voidSets up multiple backups at different timestamps by: 1.static voidvoidVerifies that PITR (Point-in-Time Restore) fails when the requested restore time is either in the future or outside the allowed retention window.voidEnsures that PITR fails when attempting to restore tables where continuous backup was not enabled.voidVerifies that PITR successfully restores multiple tables at once.voidVerifies that PITR successfully restores data for a single table.voidEnsures that PITR fails when trying to restore from a point before continuous backup started.Methods inherited from class org.apache.hadoop.hbase.backup.TestBackupBase
backupTables, backupTables, checkFailed, checkSucceeded, createBackupRequest, createBackupRequest, createBackupRequest, createTables, deleteContinuousBackupReplicationPeerIfExists, dumpBackupDir, fullTableBackup, getBackupAdmin, getLatestBackupManifest, getListOfWALFiles, incrementalTableBackup, insertIntoTable, loadTable, setUp, setUpHelper, tearDown, toList
-
Field Details
-
backupWalDirName
- See Also:
-
backupWalDir
-
fs
-
-
Constructor Details
-
TestPointInTimeRestore
public TestPointInTimeRestore()
-
-
Method Details
-
setupBeforeClass
- Throws:
Exception
-
setUpBackups
Sets up multiple backups at different timestamps by: 1. Adjusting the system time to simulate past backup points. 2. Loading data into tables to create meaningful snapshots. 3. Running full backups with or without continuous backup enabled. 4. Ensuring replication is complete before proceeding.- Throws:
Exception
-
setupAfterClass
- Throws:
IOException
-
testPITR_FailsOutsideWindow
Verifies that PITR (Point-in-Time Restore) fails when the requested restore time is either in the future or outside the allowed retention window.- Throws:
Exception
-
testPointInTimeRestore_ContinuousBackupNotEnabledTables
Ensures that PITR fails when attempting to restore tables where continuous backup was not enabled.- Throws:
Exception
-
testPointInTimeRestore_TablesWithNoProperBackupOrWals
Ensures that PITR fails when trying to restore from a point before continuous backup started.- Throws:
Exception
-
testPointInTimeRestore_SuccessfulRestoreForOneTable
Verifies that PITR successfully restores data for a single table.- Throws:
Exception
-
testPointInTimeRestore_SuccessfulRestoreForMultipleTables
Verifies that PITR successfully restores multiple tables at once.- Throws:
Exception
-