V
- value typeRBucket<V>
, RBucketAsync<V>
, RExpirable
, RExpirableAsync
, RObject
, RObjectAsync
public class RedissonTransactionalBucket<V> extends RedissonBucket<V>
codec, commandExecutor
Constructor | Description |
---|---|
RedissonTransactionalBucket(Codec codec,
CommandAsyncExecutor commandExecutor,
String name,
List<TransactionalOperation> operations,
AtomicBoolean executed,
String transactionId) |
|
RedissonTransactionalBucket(CommandAsyncExecutor commandExecutor,
String name,
List<TransactionalOperation> operations,
AtomicBoolean executed,
String transactionId) |
Modifier and Type | Method | Description |
---|---|---|
protected void |
checkState() |
|
boolean |
clearExpire() |
Clear an expire timeout or expire date for object.
|
RFuture<Boolean> |
clearExpireAsync() |
Clear an expire timeout or expire date for object in async mode.
|
RFuture<Boolean> |
compareAndSetAsync(V expect,
V update) |
Atomically sets the value to the given updated value
only if serialized state of the current value equals
to serialized state of the expected value.
|
RFuture<Boolean> |
deleteAsync() |
Delete object in async mode
|
protected <R> void |
executeLocked(RPromise<R> promise,
Runnable runnable) |
|
boolean |
expire(long timeToLive,
TimeUnit timeUnit) |
Set a timeout for object.
|
RFuture<Boolean> |
expireAsync(long timeToLive,
TimeUnit timeUnit) |
Set a timeout for object in async mode.
|
boolean |
expireAt(long timestamp) |
Set an expire date for object.
|
boolean |
expireAt(Date timestamp) |
Set an expire date for object.
|
RFuture<Boolean> |
expireAtAsync(long timestamp) |
Set an expire date for object in async mode.
|
RFuture<Boolean> |
expireAtAsync(Date timestamp) |
Set an expire date for object in async mode.
|
RFuture<V> |
getAndDeleteAsync() |
Retrieves element in the holder and removes it.
|
RFuture<V> |
getAndSetAsync(V newValue) |
Retrieves current element in the holder and replaces it with
newValue . |
RFuture<V> |
getAsync() |
Retrieves element stored in the holder.
|
RFuture<Boolean> |
isExistsAsync() |
Check object existence in async mode.
|
RFuture<Void> |
migrateAsync(String host,
int port,
int database,
long timeout) |
Transfer object from source Redis instance to destination Redis instance
in async mode
|
RFuture<Boolean> |
moveAsync(int database) |
Move object to another database in async mode
|
long |
remainTimeToLive() |
Remaining time to live of Redisson object that has a timeout
|
RFuture<Long> |
remainTimeToLiveAsync() |
Remaining time to live of Redisson object that has a timeout
|
RFuture<Void> |
setAsync(V newValue) |
Stores element into the holder.
|
RFuture<Void> |
setAsync(V value,
long timeToLive,
TimeUnit timeUnit) |
Stores element into the holder with defined
timeToLive interval. |
RFuture<Long> |
sizeAsync() |
Returns size of object in bytes
|
RFuture<Boolean> |
touchAsync() |
Update the last access time of an object in async mode.
|
RFuture<Boolean> |
trySetAsync(V newValue) |
Tries to set element atomically into empty holder.
|
RFuture<Boolean> |
trySetAsync(V value,
long timeToLive,
TimeUnit timeUnit) |
Tries to set element atomically into empty holder with defined
timeToLive interval. |
RFuture<Boolean> |
unlinkAsync() |
Delete the objects.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compareAndSet, get, getAndDelete, getAndSet, set, set, size, trySet, trySet
await, copy, copyAsync, delete, dump, dumpAsync, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getName, getName, isExists, migrate, move, prefixName, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, suffixName, toSeconds, touch, unlink
clearExpire, expire, expireAt, expireAt, remainTimeToLive
remainTimeToLiveAsync
copy, delete, dump, getCodec, getName, isExists, migrate, move, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, touch, unlink
copyAsync, dumpAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync
public RedissonTransactionalBucket(CommandAsyncExecutor commandExecutor, String name, List<TransactionalOperation> operations, AtomicBoolean executed, String transactionId)
public RedissonTransactionalBucket(Codec codec, CommandAsyncExecutor commandExecutor, String name, List<TransactionalOperation> operations, AtomicBoolean executed, String transactionId)
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
RExpirableAsync
expireAsync
in interface RExpirableAsync
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic RFuture<Boolean> expireAtAsync(Date timestamp)
RExpirableAsync
expireAtAsync
in interface RExpirableAsync
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic RFuture<Boolean> expireAtAsync(long timestamp)
RExpirableAsync
expireAtAsync
in interface RExpirableAsync
timestamp
- - expire date in seconds (Unix timestamp)true
if the timeout was set and false
if notpublic RFuture<Boolean> clearExpireAsync()
RExpirableAsync
clearExpireAsync
in interface RExpirableAsync
true
if the timeout was cleared and false
if notpublic RFuture<Boolean> moveAsync(int database)
RObjectAsync
moveAsync
in interface RObjectAsync
moveAsync
in class RedissonObject
database
- - number of Redis databasetrue
if key was moved false
if notpublic RFuture<Void> migrateAsync(String host, int port, int database, long timeout)
RObjectAsync
migrateAsync
in interface RObjectAsync
migrateAsync
in class RedissonObject
host
- - destination hostport
- - destination portdatabase
- - destination databasetimeout
- - maximum idle time in any moment of the communication with the destination instance in millisecondspublic RFuture<Long> sizeAsync()
RBucketAsync
sizeAsync
in interface RBucketAsync<V>
sizeAsync
in class RedissonBucket<V>
public RFuture<Boolean> isExistsAsync()
RObjectAsync
isExistsAsync
in interface RObjectAsync
isExistsAsync
in class RedissonObject
true
if object exists and false
otherwisepublic RFuture<Boolean> touchAsync()
RObjectAsync
touchAsync
in interface RObjectAsync
touchAsync
in class RedissonObject
true
if object was touched else false
public RFuture<Boolean> unlinkAsync()
RObjectAsync
Requires Redis 4.0+
unlinkAsync
in interface RObjectAsync
unlinkAsync
in class RedissonObject
true
if it was exist and deleted else false
public RFuture<Boolean> deleteAsync()
RObjectAsync
deleteAsync
in interface RObjectAsync
deleteAsync
in class RedissonObject
true
if object was deleted false
if notpublic RFuture<V> getAsync()
RBucketAsync
getAsync
in interface RBucketAsync<V>
getAsync
in class RedissonBucket<V>
public RFuture<Boolean> compareAndSetAsync(V expect, V update)
RBucketAsync
compareAndSetAsync
in interface RBucketAsync<V>
compareAndSetAsync
in class RedissonBucket<V>
expect
- the expected valueupdate
- the new valuetrue
if successful; or false
if the actual value
was not equal to the expected value.public RFuture<V> getAndSetAsync(V newValue)
RBucketAsync
newValue
.getAndSetAsync
in interface RBucketAsync<V>
getAndSetAsync
in class RedissonBucket<V>
newValue
- - value to setpublic RFuture<V> getAndDeleteAsync()
RBucketAsync
getAndDeleteAsync
in interface RBucketAsync<V>
getAndDeleteAsync
in class RedissonBucket<V>
public RFuture<Void> setAsync(V newValue)
RBucketAsync
setAsync
in interface RBucketAsync<V>
setAsync
in class RedissonBucket<V>
newValue
- - value to setpublic RFuture<Void> setAsync(V value, long timeToLive, TimeUnit timeUnit)
RBucketAsync
timeToLive
interval.setAsync
in interface RBucketAsync<V>
setAsync
in class RedissonBucket<V>
value
- - value to settimeToLive
- - time to live intervaltimeUnit
- - unit of time to live intervalpublic RFuture<Boolean> trySetAsync(V newValue)
RBucketAsync
trySetAsync
in interface RBucketAsync<V>
trySetAsync
in class RedissonBucket<V>
newValue
- - value to settrue
if successful, or false
if
element was already setpublic RFuture<Boolean> trySetAsync(V value, long timeToLive, TimeUnit timeUnit)
RBucketAsync
timeToLive
interval.trySetAsync
in interface RBucketAsync<V>
trySetAsync
in class RedissonBucket<V>
value
- - value to settimeToLive
- - time to live intervaltimeUnit
- - unit of time to live intervaltrue
if successful, or false
if
element was already setprotected void checkState()
public boolean expire(long timeToLive, TimeUnit timeUnit)
RExpirable
expire
in interface RExpirable
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unittrue
if the timeout was set and false
if notpublic boolean expireAt(long timestamp)
RExpirable
expireAt
in interface RExpirable
timestamp
- - expire date in milliseconds (Unix timestamp)true
if the timeout was set and false
if notpublic boolean expireAt(Date timestamp)
RExpirable
expireAt
in interface RExpirable
timestamp
- - expire datetrue
if the timeout was set and false
if notpublic boolean clearExpire()
RExpirable
clearExpire
in interface RExpirable
true
if timeout was removed
false
if object does not exist or does not have an associated timeoutpublic long remainTimeToLive()
RExpirable
remainTimeToLive
in interface RExpirable
public RFuture<Long> remainTimeToLiveAsync()
RExpirableAsync
remainTimeToLiveAsync
in interface RExpirableAsync
Copyright © 2014–2018 The Redisson Project. All rights reserved.