com.google.cloud.bigtable.hbase2_x
Class FutureUtils
- java.lang.Object
-
- com.google.cloud.bigtable.hbase2_x.FutureUtils
-
public class FutureUtils extends Object
Utility methods for converting guavaListenableFuture
Future toCompletableFuture
. Useful to convert the ListenableFuture types used by bigtable-client-core component to Java 8 CompletableFuture types used in Hbase 2- Author:
- spollapally
-
-
Field Summary
Fields Modifier and Type Field and Description static ExecutorService
DIRECT_EXECUTOR
-
Constructor Summary
Constructors Constructor and Description FutureUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static <T> CompletableFuture<T>
failedFuture(Throwable error)
static <T> CompletableFuture<T>
toCompletableFuture(com.google.api.core.ApiFuture<T> apiFuture)
static <T> CompletableFuture<T>
toCompletableFuture(ListenableFuture<T> listenableFuture)
-
-
-
Field Detail
-
DIRECT_EXECUTOR
public static final ExecutorService DIRECT_EXECUTOR
-
-
Method Detail
-
toCompletableFuture
public static <T> CompletableFuture<T> toCompletableFuture(com.google.api.core.ApiFuture<T> apiFuture)
-
toCompletableFuture
public static <T> CompletableFuture<T> toCompletableFuture(ListenableFuture<T> listenableFuture)
-
failedFuture
public static <T> CompletableFuture<T> failedFuture(Throwable error)
-
-