Package org.redisson.api
Interface RBucketAsync<V>
-
- Type Parameters:
V
- - the type of object
- All Superinterfaces:
RExpirableAsync
,RObjectAsync
- All Known Subinterfaces:
RBinaryStream
,RBucket<V>
- All Known Implementing Classes:
RedissonBinaryStream
,RedissonBucket
,RedissonTransactionalBucket
public interface RBucketAsync<V> extends RExpirableAsync
Async implementation of object holder. Max size of object is 512MB- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RFuture<Integer>
addListenerAsync(ObjectListener listener)
Adds object event listenerRFuture<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<V>
getAndDeleteAsync()
Retrieves element in the holder and removes it.RFuture<V>
getAndSetAsync(V newValue)
Retrieves current element in the holder and replaces it withnewValue
.RFuture<V>
getAndSetAsync(V value, long timeToLive, TimeUnit timeUnit)
Retrieves current element in the holder and replaces it withnewValue
with definedtimeToLive
interval.RFuture<V>
getAsync()
Retrieves element stored in the holder.RFuture<Void>
setAndKeepTTLAsync(V value)
Set value and keep existing TTL.RFuture<Void>
setAsync(V value)
Stores element into the holder.RFuture<Void>
setAsync(V value, long timeToLive, TimeUnit timeUnit)
Stores element into the holder with definedtimeToLive
interval.RFuture<Boolean>
setIfExistsAsync(V value)
Sets value only if it's already exists.RFuture<Boolean>
setIfExistsAsync(V value, long timeToLive, TimeUnit timeUnit)
Sets value only if it's already exists.RFuture<Long>
sizeAsync()
Returns size of object in bytesRFuture<Boolean>
trySetAsync(V value)
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 definedtimeToLive
interval.-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RObjectAsync
copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
-
-
-
Method Detail
-
getAndDeleteAsync
RFuture<V> getAndDeleteAsync()
Retrieves element in the holder and removes it.- Returns:
- element
-
trySetAsync
RFuture<Boolean> trySetAsync(V value)
Tries to set element atomically into empty holder.- Parameters:
value
- - value to set- Returns:
true
if successful, orfalse
if element was already set
-
trySetAsync
RFuture<Boolean> trySetAsync(V value, long timeToLive, TimeUnit timeUnit)
Tries to set element atomically into empty holder with definedtimeToLive
interval.- Parameters:
value
- - value to settimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval- Returns:
true
if successful, orfalse
if element was already set
-
setIfExistsAsync
RFuture<Boolean> setIfExistsAsync(V value)
Sets value only if it's already exists.- Parameters:
value
- - value to set- Returns:
true
if successful, orfalse
if element wasn't set
-
setIfExistsAsync
RFuture<Boolean> setIfExistsAsync(V value, long timeToLive, TimeUnit timeUnit)
Sets value only if it's already exists.- Parameters:
value
- - value to settimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval- Returns:
true
if successful, orfalse
if element wasn't set
-
compareAndSetAsync
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.- Parameters:
expect
- the expected valueupdate
- the new value- Returns:
true
if successful; orfalse
if the actual value was not equal to the expected value.
-
getAndSetAsync
RFuture<V> getAndSetAsync(V newValue)
Retrieves current element in the holder and replaces it withnewValue
.- Parameters:
newValue
- - value to set- Returns:
- previous value
-
getAndSetAsync
RFuture<V> getAndSetAsync(V value, long timeToLive, TimeUnit timeUnit)
Retrieves current element in the holder and replaces it withnewValue
with definedtimeToLive
interval.- Parameters:
value
- - value to settimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval- Returns:
- previous value
-
setAsync
RFuture<Void> setAsync(V value)
Stores element into the holder.- Parameters:
value
- - value to set- Returns:
- void
-
setAsync
RFuture<Void> setAsync(V value, long timeToLive, TimeUnit timeUnit)
Stores element into the holder with definedtimeToLive
interval.- Parameters:
value
- - value to settimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval- Returns:
- void
-
setAndKeepTTLAsync
RFuture<Void> setAndKeepTTLAsync(V value)
Set value and keep existing TTL.Requires Redis 6.0.0 and higher.
- Parameters:
value
- - value to set- Returns:
- void
-
addListenerAsync
RFuture<Integer> addListenerAsync(ObjectListener listener)
Adds object event listener- Specified by:
addListenerAsync
in interfaceRObjectAsync
- Parameters:
listener
- - object event listener- Returns:
- listener id
- See Also:
ExpiredObjectListener
,DeletedObjectListener
,SetObjectListener
-
-