Package org.apache.hadoop.hbase.snapshot
Class SnapshotReferenceUtil
java.lang.Object
org.apache.hadoop.hbase.snapshot.SnapshotReferenceUtil
Utility methods for interacting with the snapshot referenced files.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
concurrentVisitReferencedFiles
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotManifest manifest, String desc, SnapshotReferenceUtil.StoreFileVisitor visitor) static void
concurrentVisitReferencedFiles
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotManifest manifest, ExecutorService exec, SnapshotReferenceUtil.StoreFileVisitor visitor) getHFileNames
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir) Returns the store file names in the snapshot.getHFileNames
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshotDesc) Returns the store file names in the snapshot.static void
verifySnapshot
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshotDesc) Verify the validity of the snapshotstatic void
verifySnapshot
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotManifest manifest) Verify the validity of the snapshotstatic void
verifySnapshot
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotManifest manifest, SnapshotReferenceUtil.StoreFileVisitor visitor) Verify the validity of the snapshot.static void
verifyStoreFile
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot, RegionInfo regionInfo, String family, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotRegionManifest.StoreFile storeFile) Verify the validity of the snapshot store filestatic void
visitReferencedFiles
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription desc, SnapshotReferenceUtil.SnapshotVisitor visitor) Iterate over the snapshot store files, restored.edits and logsstatic void
visitReferencedFiles
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, SnapshotReferenceUtil.SnapshotVisitor visitor) Iterate over the snapshot store filesstatic void
visitRegionStoreFiles
(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotRegionManifest manifest, SnapshotReferenceUtil.StoreFileVisitor visitor) Iterate over the snapshot store files in the specified region(package private) static void
visitTableStoreFiles
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription desc, SnapshotReferenceUtil.StoreFileVisitor visitor) © Iterate over the snapshot store files
-
Field Details
-
LOG
-
-
Constructor Details
-
SnapshotReferenceUtil
private SnapshotReferenceUtil()
-
-
Method Details
-
visitReferencedFiles
public static void visitReferencedFiles(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, SnapshotReferenceUtil.SnapshotVisitor visitor) throws IOException Iterate over the snapshot store files- Parameters:
conf
- The currentConfiguration
instance.fs
-FileSystem
snapshotDir
-Path
to the Snapshot directoryvisitor
- callback object to get the referenced files- Throws:
IOException
- if an error occurred while scanning the directory
-
visitReferencedFiles
public static void visitReferencedFiles(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription desc, SnapshotReferenceUtil.SnapshotVisitor visitor) throws IOException Iterate over the snapshot store files, restored.edits and logs- Parameters:
conf
- The currentConfiguration
instance.fs
-FileSystem
snapshotDir
-Path
to the Snapshot directorydesc
- theSnapshotProtos.SnapshotDescription
of the snapshot to verifyvisitor
- callback object to get the referenced files- Throws:
IOException
- if an error occurred while scanning the directory
-
visitTableStoreFiles
static void visitTableStoreFiles(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription desc, SnapshotReferenceUtil.StoreFileVisitor visitor) throws IOException © Iterate over the snapshot store files- Parameters:
conf
- The currentConfiguration
instance.fs
-FileSystem
snapshotDir
-Path
to the Snapshot directorydesc
- theSnapshotProtos.SnapshotDescription
of the snapshot to verifyvisitor
- callback object to get the store files- Throws:
IOException
- if an error occurred while scanning the directory
-
visitRegionStoreFiles
public static void visitRegionStoreFiles(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotRegionManifest manifest, SnapshotReferenceUtil.StoreFileVisitor visitor) throws IOException Iterate over the snapshot store files in the specified region- Parameters:
manifest
- snapshot manifest to inspectvisitor
- callback object to get the store files- Throws:
IOException
- if an error occurred while scanning the directory
-
verifySnapshot
public static void verifySnapshot(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshotDesc) throws IOException Verify the validity of the snapshot- Parameters:
conf
- The currentConfiguration
instance.fs
-FileSystem
snapshotDir
-Path
to the Snapshot directory of the snapshot to verifysnapshotDesc
- theSnapshotProtos.SnapshotDescription
of the snapshot to verify- Throws:
CorruptedSnapshotException
- if the snapshot is corruptedIOException
- if an error occurred while scanning the directory
-
verifySnapshot
public static void verifySnapshot(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotManifest manifest) throws IOException Verify the validity of the snapshot- Parameters:
conf
- The currentConfiguration
instance.fs
-FileSystem
manifest
- snapshot manifest to inspect- Throws:
CorruptedSnapshotException
- if the snapshot is corruptedIOException
- if an error occurred while scanning the directory
-
verifySnapshot
public static void verifySnapshot(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotManifest manifest, SnapshotReferenceUtil.StoreFileVisitor visitor) throws IOException Verify the validity of the snapshot.- Parameters:
visitor
- user-specified store file visitor- Throws:
IOException
-
concurrentVisitReferencedFiles
public static void concurrentVisitReferencedFiles(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotManifest manifest, String desc, SnapshotReferenceUtil.StoreFileVisitor visitor) throws IOException - Throws:
IOException
-
concurrentVisitReferencedFiles
public static void concurrentVisitReferencedFiles(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotManifest manifest, ExecutorService exec, SnapshotReferenceUtil.StoreFileVisitor visitor) throws IOException - Throws:
IOException
-
verifyStoreFile
public static void verifyStoreFile(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot, RegionInfo regionInfo, String family, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotRegionManifest.StoreFile storeFile) throws IOException Verify the validity of the snapshot store file- Parameters:
conf
- The currentConfiguration
instance.fs
-FileSystem
snapshotDir
-Path
to the Snapshot directory of the snapshot to verifysnapshot
- theSnapshotProtos.SnapshotDescription
of the snapshot to verifyregionInfo
-RegionInfo
of the region that contains the store filefamily
- family that contains the store filestoreFile
- the store file to verify- Throws:
CorruptedSnapshotException
- if the snapshot is corruptedIOException
- if an error occurred while scanning the directory
-
getHFileNames
public static Set<String> getHFileNames(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir) throws IOException Returns the store file names in the snapshot.- Parameters:
conf
- The currentConfiguration
instance.fs
-FileSystem
snapshotDir
-Path
to the Snapshot directory- Returns:
- the names of hfiles in the specified snaphot
- Throws:
IOException
- if an error occurred while scanning the directory
-
getHFileNames
private static Set<String> getHFileNames(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshotDesc) throws IOException Returns the store file names in the snapshot.- Parameters:
conf
- The currentConfiguration
instance.fs
-FileSystem
snapshotDir
-Path
to the Snapshot directorysnapshotDesc
- theSnapshotProtos.SnapshotDescription
of the snapshot to inspect- Returns:
- the names of hfiles in the specified snaphot
- Throws:
IOException
- if an error occurred while scanning the directory
-