private TableName getTableNameBeforeRestoreSnapshot(final String snapshotName) throws IOException, RestoreSnapshotException { TableName tableName = null; for (SnapshotDescription snapshotInfo: listSnapshots()) { if (snapshotInfo.getName().equals(snapshotName)) { tableName = snapshotInfo.getTableName(); break; } } if (tableName == null) { throw new RestoreSnapshotException( "Unable to find the table name for snapshot=" + snapshotName); } return tableName; }
throw new RestoreSnapshotException("Snapshot in progress on the restore table=" + tableName); throw new RestoreSnapshotException("Restore already in progress on the table=" + tableName); + ClientSnapshotDescriptionUtils.toString(snapshot) + " on table=" + tableName; LOG.error(msg, e); throw new RestoreSnapshotException(msg, e);
throw new RestoreSnapshotException("Snapshot in progress on the restore table=" + tableName); throw new RestoreSnapshotException("Restore already in progress on the table=" + tableName); " on table=" + tableName; LOG.error(msg, e); throw new RestoreSnapshotException(msg, e);
"Restore snapshot=" + snapshotName + " failed. Rollback to snapshot=" + failSafeSnapshotSnapshotName + " succeeded."; future.completeExceptionally(new RestoreSnapshotException(msg));
" failed. Rollback to snapshot=" + failSafeSnapshotSnapshotName + " succeeded."; LOG.error(msg, e); throw new RestoreSnapshotException(msg, e); } catch (IOException ex) { String msg = "Failed to restore and rollback to snapshot=" + failSafeSnapshotSnapshotName; LOG.error(msg, ex); throw new RestoreSnapshotException(msg, e); throw new RestoreSnapshotException("Failed to restore snapshot=" + snapshotName, e);
future.completeExceptionally(new RestoreSnapshotException( "Unable to find the table name for snapshot=" + snapshotName)); return;
" failed because " + e.getMessage(); LOG.error(msg, e); IOException rse = new RestoreSnapshotException(msg, e, ProtobufUtil.createSnapshotDesc(snapshot));
private TableName getTableNameBeforeRestoreSnapshot(final String snapshotName) throws IOException, RestoreSnapshotException { TableName tableName = null; for (SnapshotDescription snapshotInfo: listSnapshots()) { if (snapshotInfo.getName().equals(snapshotName)) { tableName = snapshotInfo.getTableName(); break; } } if (tableName == null) { throw new RestoreSnapshotException( "Unable to find the table name for snapshot=" + snapshotName); } return tableName; }
String msg = "Restore snapshot=" + snapshotName + " failed. Rollback to snapshot=" + failSafeSnapshotSnapshotName + " succeeded."; future.completeExceptionally(new RestoreSnapshotException(msg));
future.completeExceptionally(new RestoreSnapshotException( "Unable to find the table name for snapshot=" + snapshotName)); return;
" failed. Rollback to snapshot=" + failSafeSnapshotSnapshotName + " succeeded."; LOG.error(msg, e); throw new RestoreSnapshotException(msg, e); } catch (IOException ex) { String msg = "Failed to restore and rollback to snapshot=" + failSafeSnapshotSnapshotName; LOG.error(msg, ex); throw new RestoreSnapshotException(msg, e); throw new RestoreSnapshotException("Failed to restore snapshot=" + snapshotName, e);
private TableName getTableNameBeforeRestoreSnapshot(final String snapshotName) throws IOException, RestoreSnapshotException { TableName tableName = null; for (SnapshotDescription snapshotInfo: listSnapshots()) { if (snapshotInfo.getName().equals(snapshotName)) { tableName = snapshotInfo.getTableName(); break; } } if (tableName == null) { throw new RestoreSnapshotException( "Unable to find the table name for snapshot=" + snapshotName); } return tableName; }
throw new RestoreSnapshotException("Snapshot in progress on the restore table=" + tableName); throw new RestoreSnapshotException("Restore already in progress on the table=" + tableName); " on table=" + tableName; LOG.error(msg, e); throw new RestoreSnapshotException(msg, e);
throw new RestoreSnapshotException("Snapshot in progress on the restore table=" + tableName); throw new RestoreSnapshotException("Restore already in progress on the table=" + tableName); " on table=" + tableName; LOG.error(msg, e); throw new RestoreSnapshotException(msg, e);
future.completeExceptionally(new RestoreSnapshotException( "Unable to find the table name for snapshot=" + snapshotName)); return;
/** * Clone the specified snapshot into a new table. * The operation will fail if the destination table has a snapshot or restore in progress. * * @param snapshot Snapshot Descriptor * @param hTableDescriptor Table Descriptor of the table to create */ synchronized void cloneSnapshot(final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor) throws HBaseSnapshotException { TableName tableName = hTableDescriptor.getTableName(); // 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 { CloneSnapshotHandler handler = new CloneSnapshotHandler(master, snapshot, hTableDescriptor).prepare(); this.executorService.submit(handler); this.restoreHandlers.put(tableName, handler); } catch (Exception e) { String msg = "Couldn't clone the snapshot=" + ClientSnapshotDescriptionUtils.toString(snapshot) + " on table=" + tableName; LOG.error(msg, e); throw new RestoreSnapshotException(msg, e); } }
throw new RestoreSnapshotException("Snapshot in progress on the restore table=" + tableName); throw new RestoreSnapshotException("Restore already in progress on the table=" + tableName); " on table=" + tableName; LOG.error(msg, e); throw new RestoreSnapshotException(msg, e);
throw new RestoreSnapshotException("Snapshot '" + snapshot.getName() + "' wasn't restored.");
String msg = "clone snapshot=" + SnapshotDescriptionUtils.toString(snapshot) + " failed"; LOG.error(msg, e); IOException rse = new RestoreSnapshotException(msg, e, snapshot);
" failed because " + e.getMessage(); LOG.error(msg, e); IOException rse = new RestoreSnapshotException(msg, e, snapshot);