KV: change ListenableFuture to CompletableFuture in KV APIs
@@ -11,8 +11,8 @@ import com.coreos.jetcd.options.DeleteOption;
import com.coreos.jetcd.options.GetOption;
import com.coreos.jetcd.options.PutOption;
import com.google.common.annotations.Beta;
-import com.google.common.util.concurrent.ListenableFuture;
import com.google.protobuf.ByteString;
+import java.util.concurrent.CompletableFuture;
/**
* Interface of kv client talking to etcd.
@@ -24,38 +24,38 @@ public interface KV {
// Op.PUT
// ***************
- ListenableFuture<PutResponse> put(ByteString key, ByteString value);
+ CompletableFuture<PutResponse> put(ByteString key, ByteString value);
- ListenableFuture<PutResponse> put(ByteString key, ByteString value, PutOption option);
+ CompletableFuture<PutResponse> put(ByteString key, ByteString value, PutOption option);
// ***************
// Op.GET
// ***************
- ListenableFuture<RangeResponse> get(ByteString key);
+ CompletableFuture<RangeResponse> get(ByteString key);
- ListenableFuture<RangeResponse> get(ByteString key, GetOption option);
+ CompletableFuture<RangeResponse> get(ByteString key, GetOption option);
// ***************
// Op.DELETE
// ***************
- ListenableFuture<DeleteRangeResponse> delete(ByteString key);
+ CompletableFuture<DeleteRangeResponse> delete(ByteString key);
- ListenableFuture<DeleteRangeResponse> delete(ByteString key, DeleteOption option);
+ CompletableFuture<DeleteRangeResponse> delete(ByteString key, DeleteOption option);
// ***************
// Op.COMPACT
// ***************
- ListenableFuture<CompactionResponse> compact();
+ CompletableFuture<CompactionResponse> compact();
- ListenableFuture<CompactionResponse> compact(CompactOption option);
+ CompletableFuture<CompactionResponse> compact(CompactOption option);
/**
* Commit a transaction built from {@link com.coreos.jetcd.op.Txn.Builder}.
*
* @param txn txn to commit
*/
- ListenableFuture<TxnResponse> commit(Txn txn);
+ CompletableFuture<TxnResponse> commit(Txn txn);
}
