HBASE-11201 Addendum restores Procedure#waitForCompleted() which returns void (Jerry He)

This commit is contained in:
Ted Yu 2014-05-29 18:04:38 +00:00
parent 2db8aafe7d
commit cf896d0671
1 changed files with 13 additions and 2 deletions

View File

@ -335,6 +335,17 @@ public class Procedure implements Callable<Void>, ForeignExceptionListener {
dataFromFinishedMembers.put(member, dataFromMember);
}
/**
* Waits until the entire procedure has globally completed, or has been aborted. If an
* exception is thrown the procedure may or not have run cleanup to trigger the completion latch
* yet.
* @throws ForeignException
* @throws InterruptedException
*/
public void waitForCompleted() throws ForeignException, InterruptedException {
waitForLatch(completedLatch, monitor, wakeFrequency, procName + " completed");
}
/**
* Waits until the entire procedure has globally completed, or has been aborted. If an
* exception is thrown the procedure may or not have run cleanup to trigger the completion latch
@ -343,8 +354,8 @@ public class Procedure implements Callable<Void>, ForeignExceptionListener {
* @throws ForeignException
* @throws InterruptedException
*/
public HashMap<String, byte[]> waitForCompleted() throws ForeignException, InterruptedException {
waitForLatch(completedLatch, monitor, wakeFrequency, procName + " completed");
public HashMap<String, byte[]> waitForCompletedWithRet() throws ForeignException, InterruptedException {
waitForCompleted();
return dataFromFinishedMembers;
}