Package org.apache.bookkeeper.client
Class SyncCallbackUtils
java.lang.Object
org.apache.bookkeeper.client.SyncCallbackUtils
Utility for callbacks.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> voidfinish(int rc, T result, CompletableFuture<? super T> future) Handle the Response Code and transform it to a BKException.static <T> TwaitForResult(CompletableFuture<T> future) Wait for a result.
-
Constructor Details
-
SyncCallbackUtils
SyncCallbackUtils()
-
-
Method Details
-
waitForResult
public static <T> T waitForResult(CompletableFuture<T> future) throws InterruptedException, BKException Wait for a result. This is convenience method to implement callbacks- Type Parameters:
T-- Parameters:
future-- Returns:
- Throws:
InterruptedExceptionBKException
-
finish
Handle the Response Code and transform it to a BKException.- Type Parameters:
T-- Parameters:
rc-result-future-
-