@InterfaceAudience.Private public final class SnapshotReferenceUtil extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
SnapshotReferenceUtil.FileVisitor |
Modifier and Type | Method and Description |
---|---|
static Set<String> |
getHFileNames(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path snapshotDir)
Returns the store file names in the snapshot.
|
static Set<String> |
getHLogNames(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path snapshotDir)
Returns the log file names available in the snapshot.
|
static org.apache.hadoop.fs.Path |
getLogsDir(org.apache.hadoop.fs.Path snapshotDir,
String serverName)
Get log directory for a server in a snapshot.
|
static org.apache.hadoop.fs.Path |
getRecoveredEdits(org.apache.hadoop.fs.Path snapshotDir,
String regionName,
String logfile)
Get the snapshot recovered.edits file
|
static org.apache.hadoop.fs.Path |
getRecoveredEditsDir(org.apache.hadoop.fs.Path snapshotDir,
String regionName)
Get the snapshotted recovered.edits dir for the specified region.
|
static Map<String,List<String>> |
getRegionHFileReferences(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path snapshotRegionDir)
Get the list of hfiles for the specified snapshot region.
|
static Set<String> |
getSnapshotRegionNames(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path snapshotDir)
Returns the set of region names available in the snapshot.
|
static void |
visitLogFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path snapshotDir,
FSVisitor.LogFileVisitor visitor)
Iterate over the snapshot log files
|
static void |
visitRecoveredEdits(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path snapshotDir,
FSVisitor.RecoveredEditsVisitor visitor)
Iterate over the snapshot recovered.edits
|
static void |
visitReferencedFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path snapshotDir,
SnapshotReferenceUtil.FileVisitor visitor)
Iterate over the snapshot store files, restored.edits and logs
|
static void |
visitRegionStoreFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path regionDir,
FSVisitor.StoreFileVisitor visitor)
Iterate over the snapshot store files in the specified region
|
static void |
visitTableStoreFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path snapshotDir,
FSVisitor.StoreFileVisitor visitor)
Iterate over the snapshot store files
|
public static org.apache.hadoop.fs.Path getLogsDir(org.apache.hadoop.fs.Path snapshotDir, String serverName)
snapshotDir
- directory where the specific snapshot is storedserverName
- name of the parent regionserver for the log filespublic static org.apache.hadoop.fs.Path getRecoveredEditsDir(org.apache.hadoop.fs.Path snapshotDir, String regionName)
snapshotDir
- directory where the specific snapshot is storedregionName
- name of the regionpublic static org.apache.hadoop.fs.Path getRecoveredEdits(org.apache.hadoop.fs.Path snapshotDir, String regionName, String logfile)
snapshotDir
- directory where the specific snapshot is storedregionName
- name of the regionlogfile
- name of the edit filepublic static void visitReferencedFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, SnapshotReferenceUtil.FileVisitor visitor) throws IOException
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 visitTableStoreFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, FSVisitor.StoreFileVisitor visitor) throws IOException
fs
- FileSystem
snapshotDir
- Path
to the Snapshot directoryvisitor
- callback object to get the store filesIOException
- if an error occurred while scanning the directorypublic static void visitRegionStoreFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path regionDir, FSVisitor.StoreFileVisitor visitor) throws IOException
fs
- FileSystem
regionDir
- Path
to the Snapshot region directoryvisitor
- callback object to get the store filesIOException
- if an error occurred while scanning the directorypublic static void visitRecoveredEdits(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, FSVisitor.RecoveredEditsVisitor visitor) throws IOException
fs
- FileSystem
snapshotDir
- Path
to the Snapshot directoryvisitor
- callback object to get the recovered.edits filesIOException
- if an error occurred while scanning the directorypublic static void visitLogFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.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 Set<String> getSnapshotRegionNames(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir) throws IOException
fs
- FileSystem
snapshotDir
- Path
to the Snapshot directoryIOException
- if an error occurred while scanning the directorypublic static Map<String,List<String>> getRegionHFileReferences(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotRegionDir) throws IOException
fs
- FileSystem
snapshotRegionDir
- Path
to the Snapshot region directoryIOException
- if an error occurred while scanning the directorypublic static Set<String> getHFileNames(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir) throws IOException
fs
- FileSystem
snapshotDir
- Path
to the Snapshot directoryIOException
- if an error occurred while scanning the directorypublic static Set<String> getHLogNames(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir) throws IOException
fs
- FileSystem
snapshotDir
- Path
to the Snapshot directoryIOException
- if an error occurred while scanning the directoryCopyright © 2013 The Apache Software Foundation. All rights reserved.