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
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconcurrentVisitReferencedFiles(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotManifest manifest, String desc, SnapshotReferenceUtil.StoreFileVisitor visitor) static voidconcurrentVisitReferencedFiles(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 voidverifySnapshot(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 voidverifySnapshot(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotManifest manifest) Verify the validity of the snapshotstatic voidverifySnapshot(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotManifest manifest, SnapshotReferenceUtil.StoreFileVisitor visitor) Verify the validity of the snapshot.static voidverifyStoreFile(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 voidvisitReferencedFiles(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 voidvisitReferencedFiles(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 voidvisitRegionStoreFiles(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 voidvisitTableStoreFiles(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 currentConfigurationinstance.fs-FileSystemsnapshotDir-Pathto 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 currentConfigurationinstance.fs-FileSystemsnapshotDir-Pathto the Snapshot directorydesc- theSnapshotProtos.SnapshotDescriptionof 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 currentConfigurationinstance.fs-FileSystemsnapshotDir-Pathto the Snapshot directorydesc- theSnapshotProtos.SnapshotDescriptionof 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 currentConfigurationinstance.fs-FileSystemsnapshotDir-Pathto the Snapshot directory of the snapshot to verifysnapshotDesc- theSnapshotProtos.SnapshotDescriptionof 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 currentConfigurationinstance.fs-FileSystemmanifest- 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 currentConfigurationinstance.fs-FileSystemsnapshotDir-Pathto the Snapshot directory of the snapshot to verifysnapshot- theSnapshotProtos.SnapshotDescriptionof the snapshot to verifyregionInfo-RegionInfoof 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 currentConfigurationinstance.fs-FileSystemsnapshotDir-Pathto 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 currentConfigurationinstance.fs-FileSystemsnapshotDir-Pathto the Snapshot directorysnapshotDesc- theSnapshotProtos.SnapshotDescriptionof the snapshot to inspect- Returns:
- the names of hfiles in the specified snaphot
- Throws:
IOException- if an error occurred while scanning the directory
-