@InterfaceAudience.Private public final class SnapshotReferenceUtil extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
SnapshotReferenceUtil.SnapshotVisitor |
static interface |
SnapshotReferenceUtil.StoreFileVisitor |
Modifier and Type | Field and Description |
---|---|
static Log |
LOG |
Modifier and Type | Method and Description |
---|---|
static void |
concurrentVisitReferencedFiles(Configuration conf,
FileSystem fs,
SnapshotManifest manifest,
SnapshotReferenceUtil.StoreFileVisitor visitor) |
static Set<String> |
getHFileNames(Configuration conf,
FileSystem fs,
Path snapshotDir)
Returns the store file names in the snapshot.
|
static Path |
getLogsDir(Path snapshotDir,
String serverName)
Get log directory for a server in a snapshot.
|
static Set<String> |
getWALNames(FileSystem fs,
Path snapshotDir)
Returns the log file names available in the snapshot.
|
static void |
verifySnapshot(Configuration conf,
FileSystem fs,
Path snapshotDir,
HBaseProtos.SnapshotDescription snapshotDesc)
Verify the validity of the snapshot
|
static void |
verifySnapshot(Configuration conf,
FileSystem fs,
SnapshotManifest manifest)
Verify the validity of the snapshot
|
static void |
visitLogFiles(FileSystem fs,
Path snapshotDir,
FSVisitor.LogFileVisitor visitor)
Iterate over the snapshot log files
|
static void |
visitReferencedFiles(Configuration conf,
FileSystem fs,
Path snapshotDir,
HBaseProtos.SnapshotDescription desc,
SnapshotReferenceUtil.SnapshotVisitor visitor)
Iterate over the snapshot store files, restored.edits and logs
|
static void |
visitReferencedFiles(Configuration conf,
FileSystem fs,
Path snapshotDir,
SnapshotReferenceUtil.SnapshotVisitor visitor)
Iterate over the snapshot store files, restored.edits and logs
|
public static Path getLogsDir(Path snapshotDir, String serverName)
snapshotDir
- directory where the specific snapshot is storedserverName
- name of the parent regionserver for the log filespublic static void visitReferencedFiles(Configuration conf, FileSystem fs, Path snapshotDir, SnapshotReferenceUtil.SnapshotVisitor visitor) throws IOException
conf
- The current Configuration
instance.fs
- FileSystem
snapshotDir
- Path
to the Snapshot directoryvisitor
- callback object to get the referenced filesIOException
- if an error occurred while scanning the directorypublic static void visitReferencedFiles(Configuration conf, FileSystem fs, Path snapshotDir, HBaseProtos.SnapshotDescription desc, SnapshotReferenceUtil.SnapshotVisitor visitor) throws IOException
conf
- The current Configuration
instance.fs
- FileSystem
snapshotDir
- Path
to the Snapshot directorydesc
- the HBaseProtos.SnapshotDescription
of the snapshot to verifyvisitor
- callback object to get the referenced filesIOException
- if an error occurred while scanning the directorypublic static void visitLogFiles(FileSystem fs, Path snapshotDir, FSVisitor.LogFileVisitor visitor) throws IOException
fs
- FileSystem
snapshotDir
- Path
to the Snapshot directoryvisitor
- callback object to get the log filesIOException
- if an error occurred while scanning the directorypublic static void verifySnapshot(Configuration conf, FileSystem fs, Path snapshotDir, HBaseProtos.SnapshotDescription snapshotDesc) throws IOException
conf
- The current Configuration
instance.fs
- FileSystem
snapshotDir
- Path
to the Snapshot directory of the snapshot to verifysnapshotDesc
- the HBaseProtos.SnapshotDescription
of the snapshot to verifyCorruptedSnapshotException
- if the snapshot is corruptedIOException
- if an error occurred while scanning the directorypublic static void verifySnapshot(Configuration conf, FileSystem fs, SnapshotManifest manifest) throws IOException
conf
- The current Configuration
instance.fs
- FileSystem
manifest
- snapshot manifest to inspectCorruptedSnapshotException
- if the snapshot is corruptedIOException
- if an error occurred while scanning the directorypublic static void concurrentVisitReferencedFiles(Configuration conf, FileSystem fs, SnapshotManifest manifest, SnapshotReferenceUtil.StoreFileVisitor visitor) throws IOException
IOException
public static Set<String> getHFileNames(Configuration conf, FileSystem fs, Path snapshotDir) throws IOException
conf
- The current Configuration
instance.fs
- FileSystem
snapshotDir
- Path
to the Snapshot directoryIOException
- if an error occurred while scanning the directorypublic static Set<String> getWALNames(FileSystem fs, Path snapshotDir) throws IOException
fs
- FileSystem
snapshotDir
- Path
to the Snapshot directoryIOException
- if an error occurred while scanning the directory