hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
/**
   * Triggers an asynchronous attempt to take a snapshot.
   * {@inheritDoc}
   */
Triggers an asynchronous attempt to take a snapshot.
Triggers an asynchronous attempt to take a snapshot .
@Override
  public SnapshotResponse snapshot(RpcController controller,
      SnapshotRequest request) throws ServiceException {
    try {
      master.checkInitialized();
      master.snapshotManager.checkSnapshotSupport();
      LOG.info(master.getClientIdAuditPrefix() + " snapshot request for:" +
        ClientSnapshotDescriptionUtils.toString(request.getSnapshot()));
      SnapshotDescription snapshot = SnapshotDescriptionUtils.validate(
        request.getSnapshot(), master.getConfiguration());
      master.snapshotManager.takeSnapshot(snapshot);
      long waitTime = SnapshotDescriptionUtils.getMaxMasterTimeout(master.getConfiguration(),
        snapshot.getType(), SnapshotDescriptionUtils.DEFAULT_MAX_WAIT_TIME);
      return SnapshotResponse.newBuilder().setExpectedTimeout(waitTime).build();
    } catch (ForeignException e) {
      throw new ServiceException(e.getCause());
    } catch (IOException e) {
      throw new ServiceException(e);
    }
  }
@ Override public SnapshotResponse snapshot ( RpcController controller , SnapshotRequest request ) throws ServiceException { try { master . checkInitialized ( ) ; master . snapshotManager . checkSnapshotSupport ( ) ; LOG . info ( master . getClientIdAuditPrefix ( ) + " snapshot request for:" + ClientSnapshotDescriptionUtils . toString ( request . getSnapshot ( ) ) ) ; SnapshotDescription snapshot = SnapshotDescriptionUtils . validate ( request . getSnapshot ( ) , master . getConfiguration ( ) ) ; master . snapshotManager . takeSnapshot ( snapshot ) ; long waitTime = SnapshotDescriptionUtils . getMaxMasterTimeout ( master . getConfiguration ( ) , snapshot . getType ( ) , SnapshotDescriptionUtils . DEFAULT_MAX_WAIT_TIME ) ; return SnapshotResponse . newBuilder ( ) . setExpectedTimeout ( waitTime ) . build ( ) ; } catch ( ForeignException e ) { throw new ServiceException ( e . getCause ( ) ) ; } catch ( IOException e ) { throw new ServiceException ( e ) ; } }
Triggers an asynchronous attempt to take a snapshot.
Triggers an asynchronous attempt to take a snapshot .
// get the snapshot information // send back the max amount of time the client should wait for the snapshot to complete