org.apache.hadoop.hbase.master.snapshot
Class MasterSnapshotVerifier
java.lang.Object
org.apache.hadoop.hbase.master.snapshot.MasterSnapshotVerifier
@InterfaceAudience.Private
@InterfaceStability.Unstable
public final class MasterSnapshotVerifier
- extends Object
General snapshot verification on the master.
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:
- SnapshotDescription is readable
- Table info is readable
- Regions
- Matching regions in the snapshot as currently in the table
HRegionInfo
matches the current and stored regions
- All referenced hfiles have valid names
- All the hfiles are present (either in .archive directory in the region)
- All recovered.edits files are present (by name) and have the correct file size
Method Summary |
void |
verifySnapshot(org.apache.hadoop.fs.Path snapshotDir,
Set<String> snapshotServers)
Verify that the snapshot in the directory is a valid snapshot |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MasterSnapshotVerifier
public MasterSnapshotVerifier(MasterServices services,
HBaseProtos.SnapshotDescription snapshot,
org.apache.hadoop.fs.Path rootDir)
- Parameters:
services
- services for the mastersnapshot
- snapshot to checkrootDir
- root directory of the hbase installation.
verifySnapshot
public void verifySnapshot(org.apache.hadoop.fs.Path snapshotDir,
Set<String> snapshotServers)
throws CorruptedSnapshotException,
IOException
- Verify that the snapshot in the directory is a valid snapshot
- Parameters:
snapshotDir
- snapshot directory to checksnapshotServers
- ServerName
of the servers that are involved in the snapshot
- Throws:
CorruptedSnapshotException
- if the snapshot is invalid
IOException
- if there is an unexpected connection issue to the filesystem
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.