Class DisabledTableSnapshotHandler

All Implemented Interfaces:
Comparable<EventHandler>, Runnable, ForeignExceptionSnare, SnapshotSentinel

@Private @Evolving public class DisabledTableSnapshotHandler extends TakeSnapshotHandler
Take a snapshot of a disabled table.

Table must exist when taking the snapshot, or results are undefined.

  • Field Details

    • LOG

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

    • DisabledTableSnapshotHandler

      public DisabledTableSnapshotHandler(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot, MasterServices masterServices, SnapshotManager snapshotManager) throws IOException
      Parameters:
      snapshot - descriptor of the snapshot to take
      masterServices - master services provider
      Throws:
      IOException - if it cannot access the filesystem of the snapshot temporary directory
  • Method Details

    • prepare

      Description copied from class: EventHandler
      Event handlers should do all the necessary checks in this method (rather than in the constructor, or in process()) so that the caller, which is mostly executed in the ipc context can fail fast. Process is executed async from the client ipc, so this method gives a quick chance to do some basic checks. Should be called after constructing the EventHandler, and before process().
      Overrides:
      prepare in class TakeSnapshotHandler
      Returns:
      the instance of this class
      Throws:
      Exception - when something goes wrong
    • snapshotRegions

      public void snapshotRegions(List<Pair<RegionInfo,ServerName>> regionsAndLocations) throws IOException, org.apache.zookeeper.KeeperException
      Description copied from class: TakeSnapshotHandler
      Snapshot the specified regions
      Specified by:
      snapshotRegions in class TakeSnapshotHandler
      Throws:
      IOException
      org.apache.zookeeper.KeeperException
    • downgradeToSharedTableLock

      protected boolean downgradeToSharedTableLock()
      Description copied from class: TakeSnapshotHandler
      When taking snapshot, first we must acquire the exclusive table lock to confirm that there are no ongoing merge/split procedures. But later, we should try our best to release the exclusive lock as this may hurt the availability, because we need to hold the shared lock when assigning regions.

      See HBASE-21480 for more details.

      Specified by:
      downgradeToSharedTableLock in class TakeSnapshotHandler