@Override
  public TakeSnapshotHandler prepare() throws Exception {
    super.prepare();
    // after this, you should ensure to release this lock in case of exceptions
    if (this.tableLock.tryAcquire(this.lockAcquireTimeoutMs)) {
      try {
        this.htd = loadTableDescriptor(); // check that .tableinfo is present
      } catch (Exception e) {
        this.tableLock.release();
        throw e;
      }
    } else {
      LOG.error("Master lock could not be acquired in {} ms", lockAcquireTimeoutMs);
      throw new DoNotRetryIOException("Master lock could not be acquired");
    }
    return this;
  }
@param snapshot       descriptor of the snapshot to take
@param masterServices master services provider
@throws IllegalArgumentException if the working snapshot directory set from the configuration
                                 is the same as the completed snapshot directory
@throws IOException              if the file system of the working snapshot directory cannot be
                                 determined
hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/TakeSnapshotHandler.java