Examples of RestoreSnapshotException


Examples of org.apache.hadoop.hbase.snapshot.RestoreSnapshotException

      final HTableDescriptor hTableDescriptor) throws HBaseSnapshotException {
    String tableName = hTableDescriptor.getNameAsString();

    // make sure we aren't running a snapshot on the same table
    if (isTakingSnapshot(tableName)) {
      throw new RestoreSnapshotException("Snapshot in progress on the restore table=" + tableName);
    }

    // make sure we aren't running a restore on the same table
    if (isRestoringTable(tableName)) {
      throw new RestoreSnapshotException("Restore already in progress on the table=" + tableName);
    }

    try {
      RestoreSnapshotHandler handler =
        new RestoreSnapshotHandler(master, snapshot, hTableDescriptor, metricsMaster);
      this.executorService.submit(handler);
      restoreHandlers.put(hTableDescriptor.getNameAsString(), handler);
    } catch (Exception e) {
      String msg = "Couldn't restore the snapshot=" + SnapshotDescriptionUtils.toString(
          snapshot+
          " on table=" + tableName;
      LOG.error(msg, e);
      throw new RestoreSnapshotException(msg, e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.