public final class MasterSnapshotVerifier extends java.lang.Object
This is a light-weight verification mechanism for all the files in a snapshot. It doesn't attempt to verify that the files are exact copies (that would be paramount to taking the snapshot again!), but instead just attempts to ensure that the files match the expected files and are the same length.
Taking an online snapshots can race against other operations and this is an last line of defense. For example, if meta changes between when snapshots are taken not all regions of a table may be present. This can be caused by a region split (daughters present on this scan, but snapshot took parent), or move (snapshots only checks lists of region servers, a move could have caused a region to be skipped or done twice).
Current snapshot files checked:
RegionInfomatches the current and stored regions
|Constructor and Description|
|Modifier and Type||Method and Description|
Verify that the snapshot in the directory is a valid snapshot
public MasterSnapshotVerifier(MasterServices services, SnapshotDescription snapshot, Path rootDir)
services- services for the master
snapshot- snapshot to check
rootDir- root directory of the hbase installation.
public void verifySnapshot(Path snapshotDir, java.util.Set<java.lang.String> snapshotServers) throws CorruptedSnapshotException, java.io.IOException
snapshotDir- snapshot directory to check
org.apache.hadoop.hbase.ServerNameof the servers that are involved in the snapshot
CorruptedSnapshotException- if the snapshot is invalid
java.io.IOException- if there is an unexpected connection issue to the filesystem