ReliableHashMap<K,V>.containsKeyAsync 方法

定义

重载

containsKeyAsync(Transaction txn, K key)

Tests if the specified object is a key in this table.

containsKeyAsync(Transaction txn, K key, Duration timeout, CancellationToken cancellationToken)

Tests if the specified object is a key in this table.

containsKeyAsync(Transaction txn, K key, LockMode lockMode)

Tests if the specified object is a key in this table.

containsKeyAsync(Transaction txn, K key, LockMode lockMode, Duration timeout, CancellationToken cancellationToken)

Tests if the specified object is a key in this table.

containsKeyAsync(Transaction txn, K key)

Tests if the specified object is a key in this table.

public CompletableFuture<Boolean> containsKeyAsync(Transaction txn, K key)

参数

txn
Transaction

The transaction id associated with this operation.

key
K

possible key

返回

CompletableFuture<Boolean>

CompletableFuture with result true if the key is found in this Map, false otherwise. The future completes exceptionally with FabricException for fabric related failures.

例外

IllegalArgumentException

if key or txn is null.

containsKeyAsync(Transaction txn, K key, Duration timeout, CancellationToken cancellationToken)

Tests if the specified object is a key in this table.

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

参数

txn
Transaction

The transaction id associated with this operation.

key
K

possible 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 the key is found in this Map, false otherwise. The future completes exceptionally with FabricException for fabric related failures.

例外

IllegalArgumentException

if key or txn is null.

containsKeyAsync(Transaction txn, K key, LockMode lockMode)

Tests if the specified object is a key in this table.

public CompletableFuture<Boolean> containsKeyAsync(Transaction txn, K key, LockMode lockMode)

参数

txn
Transaction

The transaction id associated with this operation.

key
K

possible key

lockMode
LockMode

The lock mode to obtain while checking for presence of the key.

返回

CompletableFuture<Boolean>

CompletableFuture with result true if the key is found in this Map, false otherwise. The future completes exceptionally with FabricException for fabric related failures.

例外

IllegalArgumentException

if key or txn is null.

containsKeyAsync(Transaction txn, K key, LockMode lockMode, Duration timeout, CancellationToken cancellationToken)

Tests if the specified object is a key in this table.

public CompletableFuture<Boolean> containsKeyAsync(Transaction txn, K key, LockMode lockMode, Duration timeout, CancellationToken cancellationToken)

参数

txn
Transaction

The transaction id associated with this operation.

key
K

possible key

lockMode
LockMode

The lock mode to obtain while checking for presence of the 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 the key is found in this Map, false otherwise. The future completes exceptionally with FabricException for fabric related failures.

例外

IllegalArgumentException

if key or txn is null.

适用于