Package org.apache.hadoop.hbase.master

Examples of org.apache.hadoop.hbase.master.SnapshotSentinel


  private synchronized void cleanupSentinels(final Map<String, SnapshotSentinel> sentinels) {
    long currentTime = EnvironmentEdgeManager.currentTimeMillis();
    Iterator<Map.Entry<String, SnapshotSentinel>> it = sentinels.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry<String, SnapshotSentinel> entry = it.next();
      SnapshotSentinel sentinel = entry.getValue();
      if (sentinel.isFinished() &&
          (currentTime - sentinel.getCompletionTimestamp()) > SNAPSHOT_SENTINELS_CLEANUP_TIMEOUT)
      {
        it.remove();
      }
    }
  }
View Full Code Here


   *
   * @param tableName table under restore
   * @return <tt>true</tt> if there is a restore in progress of the specified table.
   */
  private boolean isRestoringTable(final String tableName) {
    SnapshotSentinel sentinel = restoreHandlers.get(tableName);
    return(sentinel != null && !sentinel.isFinished());
  }
View Full Code Here

    if (!isSnapshotCompleted(snapshot)) {
      throw new UnknownSnapshotException("Snapshot:" + snapshot.getName()
          + " is not one of the known completed snapshots.");
    }

    SnapshotSentinel sentinel = getRestoreSnapshotSentinel(snapshot.getTable());
    if (sentinel == null) {
      // there is no sentinel so restore is not in progress.
      return false;
    }
    if (!sentinel.getSnapshot().getName().equals(snapshot.getName())) {
      // another handler is trying to restore to the table, but it isn't the same snapshot source.
      return false;
    }

    LOG.debug("Verify snapshot=" + snapshot.getName() + " against="
        + sentinel.getSnapshot().getName() + " table=" + snapshot.getTable());
    ForeignException e = sentinel.getExceptionIfFailed();
    if (e != null) throw e;

    // check to see if we are done
    if (sentinel.isFinished()) {
      LOG.debug("Restore snapshot=" + SnapshotDescriptionUtils.toString(snapshot) +
          " has completed. Notifying the client.");
      return false;
    }
View Full Code Here

   */
  private synchronized void cleanupRestoreSentinels() {
    Iterator<Map.Entry<String, SnapshotSentinel>> it = restoreHandlers.entrySet().iterator();
    while (it.hasNext()) {
        Map.Entry<String, SnapshotSentinel> entry = it.next();
        SnapshotSentinel sentinel = entry.getValue();
        if (sentinel.isFinished()) {
          it.remove();
        }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.master.SnapshotSentinel

Copyright © 2018 www.massapicom. 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.