Package org.apache.bookkeeper.client
Class SyncCallbackUtils
- java.lang.Object
-
- org.apache.bookkeeper.client.SyncCallbackUtils
-
class SyncCallbackUtils extends java.lang.Object
Utility for callbacks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
SyncCallbackUtils.FutureReadLastConfirmed
(package private) static class
SyncCallbackUtils.FutureReadLastConfirmedAndEntry
(package private) static class
SyncCallbackUtils.LastAddConfirmedCallback
(package private) static class
SyncCallbackUtils.SyncAddCallback
(package private) static class
SyncCallbackUtils.SyncCloseCallback
(package private) static class
SyncCallbackUtils.SyncCreateAdvCallback
(package private) static class
SyncCallbackUtils.SyncCreateCallback
(package private) static class
SyncCallbackUtils.SyncDeleteCallback
(package private) static class
SyncCallbackUtils.SyncOpenCallback
(package private) static class
SyncCallbackUtils.SyncReadCallback
(package private) static class
SyncCallbackUtils.SyncReadLastConfirmedCallback
-
Constructor Summary
Constructors Constructor Description SyncCallbackUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> void
finish(int rc, T result, java.util.concurrent.CompletableFuture<? super T> future)
Handle the Response Code and transform it to a BKException.static <T> T
waitForResult(java.util.concurrent.CompletableFuture<T> future)
Wait for a result.
-
-
-
Method Detail
-
waitForResult
public static <T> T waitForResult(java.util.concurrent.CompletableFuture<T> future) throws java.lang.InterruptedException, BKException
Wait for a result. This is convenience method to implement callbacks- Type Parameters:
T
-- Parameters:
future
-- Returns:
- Throws:
java.lang.InterruptedException
BKException
-
finish
public static <T> void finish(int rc, T result, java.util.concurrent.CompletableFuture<? super T> future)
Handle the Response Code and transform it to a BKException.- Type Parameters:
T
-- Parameters:
rc
-result
-future
-
-
-