diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java index f46c855..ba27d5a 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java @@ -1276,12 +1276,12 @@ public interface Admin extends Abortable, Closeable { * single snapshot should be taken at a time, or results may be undefined. * * @param snapshot snapshot to take - * @return response from the server indicating the max time to wait for the snapshot + * @return timeout from the server indicating the max time to wait for the snapshot * @throws IOException if the snapshot did not succeed or we lose contact with the master. * @throws SnapshotCreationException if snapshot creation failed * @throws IllegalArgumentException if the snapshot request is formatted incorrectly */ - MasterProtos.SnapshotResponse takeSnapshotAsync(HBaseProtos.SnapshotDescription snapshot) + long takeSnapshotAsync(HBaseProtos.SnapshotDescription snapshot) throws IOException, SnapshotCreationException; /** diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index 8ba26ba..f7d333a 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -2277,23 +2277,24 @@ public class HBaseAdmin implements Admin { public void snapshot(SnapshotDescription snapshot) throws IOException, SnapshotCreationException, IllegalArgumentException { // actually take the snapshot - SnapshotResponse response = takeSnapshotAsync(snapshot); - waitForSnapshot(snapshot, response.getExpectedTimeout(), getConnection()); + long timeout = takeSnapshotAsync(snapshot); + waitForSnapshot(snapshot, timeout, getConnection()); } @Override - public SnapshotResponse takeSnapshotAsync(SnapshotDescription snapshot) throws IOException, + public long takeSnapshotAsync(SnapshotDescription snapshot) throws IOException, SnapshotCreationException { ClientSnapshotDescriptionUtils.assertSnapshotRequestIsValid(snapshot); final SnapshotRequest request = SnapshotRequest.newBuilder().setSnapshot(snapshot) .build(); // run the snapshot on the master - return executeCallable(new MasterCallable(getConnection()) { + SnapshotResponse resp = executeCallable(new MasterCallable(getConnection()) { @Override public SnapshotResponse call(int callTimeout) throws ServiceException { return master.snapshot(null, request); } }); + return resp.getExpectedTimeout(); } @Override