ReliableHashMap<K,V>.removeAsync 方法
定义
重载
removeAsync(Transaction txn, K key) |
Removes the key (and its corresponding value) from this map. This method does nothing if the key is not in the map.
|
removeAsync(Transaction txn, K key, Duration timeout, CancellationToken cancellationToken) |
Removes the key (and its corresponding value) from this map. This method does nothing if the key is not in the map.
|
removeAsync(Transaction txn, K key)
Removes the key (and its corresponding value) from this map. This method does nothing if the key is not in the map.
public CompletableFuture<Boolean> removeAsync(Transaction txn, K key)
参数
- txn
- Transaction
The transaction id associated with this operation.
- key
- K
the key that needs to be removed.
返回
CompletableFuture with result true if the key is found and remove succeeds, false otherwise. The future completes exceptionally with FabricException for fabric related failures.
例外
if key or txn is null.
removeAsync(Transaction txn, K key, Duration timeout, CancellationToken cancellationToken)
Removes the key (and its corresponding value) from this map. This method does nothing if the key is not in the map.
public CompletableFuture<Boolean> removeAsync(Transaction txn, K key, Duration timeout, CancellationToken cancellationToken)
参数
- txn
- Transaction
The transaction id associated with this operation.
- key
- K
the key that needs to be removed.
- 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 with result true if the key is found and remove succeeds, false otherwise. The future completes exceptionally with FabricException for fabric related failures.
例外
if key or txn is null.