ReliableHashMap<K,V>.putAsync 方法

定义

重载

putAsync(Transaction txn, K key, V value)

Maps the specified key to the specified value in this table. Neither the key nor the value can be null.

putAsync(Transaction txn, K key, V value, Duration timeout, CancellationToken cancellationToken)

Maps the specified key to the specified value in this table. Neither the key nor the value can be null.

putAsync(Transaction txn, K key, V value)

Maps the specified key to the specified value in this table. Neither the key nor the value can be null.

public CompletableFuture<Boolean> putAsync(Transaction txn, K key, V value)

参数

txn
Transaction

The transaction id associated with this operation.

key
K

key with which the specified value is to be associated

value
V

value to be associated with the specified key

返回

CompletableFuture<Boolean>

CompletableFuture with result true if there was a previous mapping, false otherwise. The future completes exceptionally with IOException for serialization failures, FabricException for fabric related failures.

例外

IllegalArgumentException

if key, value or txn is null.

putAsync(Transaction txn, K key, V value, Duration timeout, CancellationToken cancellationToken)

Maps the specified key to the specified value in this table. Neither the key nor the value can be null.

public CompletableFuture<Boolean> putAsync(Transaction txn, K key, V value, Duration timeout, CancellationToken cancellationToken)

参数

txn
Transaction

The transaction id associated with this operation.

key
K

key with which the specified value is to be associated

value
V

value to be associated with the specified key

timeout
Duration

the timeout for the operation to complete. Default timeout(4 seconds) will be used if null is passed.

cancellationToken
CancellationToken

CancellationToken object to indicate the cancellation status of the operation.

返回

CompletableFuture<Boolean>

CompletableFuture with result true if there was a previous mapping, false otherwise. The future completes exceptionally with IOException for serialization failures, FabricException for fabric related failures.

例外

IllegalArgumentException

if key, value or txn is null.

适用于