Class SnapshotReferenceUtil

java.lang.Object
org.apache.hadoop.hbase.snapshot.SnapshotReferenceUtil

@Private public final class SnapshotReferenceUtil extends Object
Utility methods for interacting with the snapshot referenced files.
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
  • Constructor Details

  • 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 current Configuration instance.
      fs - FileSystem
      snapshotDir - Path to the Snapshot directory
      visitor - 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 current Configuration instance.
      fs - FileSystem
      snapshotDir - Path to the Snapshot directory
      desc - the SnapshotProtos.SnapshotDescription of the snapshot to verify
      visitor - 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 current Configuration instance.
      fs - FileSystem
      snapshotDir - Path to the Snapshot directory
      desc - the SnapshotProtos.SnapshotDescription of the snapshot to verify
      visitor - 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 inspect
      visitor - 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 current Configuration instance.
      fs - FileSystem
      snapshotDir - Path to the Snapshot directory of the snapshot to verify
      snapshotDesc - the SnapshotProtos.SnapshotDescription of the snapshot to verify
      Throws:
      CorruptedSnapshotException - if the snapshot is corrupted
      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, SnapshotManifest manifest) throws IOException
      Verify the validity of the snapshot
      Parameters:
      conf - The current Configuration instance.
      fs - FileSystem
      manifest - snapshot manifest to inspect
      Throws:
      CorruptedSnapshotException - if the snapshot is corrupted
      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, 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 current Configuration instance.
      fs - FileSystem
      snapshotDir - Path to the Snapshot directory of the snapshot to verify
      snapshot - the SnapshotProtos.SnapshotDescription of the snapshot to verify
      regionInfo - RegionInfo of the region that contains the store file
      family - family that contains the store file
      storeFile - the store file to verify
      Throws:
      CorruptedSnapshotException - if the snapshot is corrupted
      IOException - 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 current Configuration 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 current Configuration instance.
      fs - FileSystem
      snapshotDir - Path to the Snapshot directory
      snapshotDesc - the SnapshotProtos.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