Package org.redisson.api
Interface RBucketRx<V>
-
- Type Parameters:
V
- - the type of object
- All Superinterfaces:
RExpirableRx
,RObjectRx
- All Known Subinterfaces:
RBinaryStreamRx
public interface RBucketRx<V> extends RExpirableRx
Reactive 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 io.reactivex.rxjava3.core.Single<Boolean>
compareAndSet(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.io.reactivex.rxjava3.core.Maybe<V>
get()
Retrieves element stored in the holder.io.reactivex.rxjava3.core.Maybe<V>
getAndDelete()
Retrieves element in the holder and removes it.io.reactivex.rxjava3.core.Maybe<V>
getAndSet(V newValue)
Retrieves current element in the holder and replaces it withnewValue
.io.reactivex.rxjava3.core.Maybe<V>
getAndSet(V value, long timeToLive, TimeUnit timeUnit)
Retrieves current element in the holder and replaces it withnewValue
with definedtimeToLive
interval.io.reactivex.rxjava3.core.Completable
set(V value)
Stores element into the holder.io.reactivex.rxjava3.core.Completable
set(V value, long timeToLive, TimeUnit timeUnit)
Stores element into the holder with definedtimeToLive
interval.io.reactivex.rxjava3.core.Completable
setAndKeepTTL(V value)
Set value and keep existing TTL.io.reactivex.rxjava3.core.Single<Boolean>
setIfExists(V value)
Sets value only if it's already exists.io.reactivex.rxjava3.core.Single<Boolean>
setIfExists(V value, long timeToLive, TimeUnit timeUnit)
Sets value only if it's already exists.io.reactivex.rxjava3.core.Single<Long>
size()
Returns size of object in bytesio.reactivex.rxjava3.core.Single<Boolean>
trySet(V value)
Tries to set element atomically into empty holder.io.reactivex.rxjava3.core.Single<Boolean>
trySet(V value, long timeToLive, TimeUnit timeUnit)
Tries to set element atomically into empty holder with definedtimeToLive
interval.-
Methods inherited from interface org.redisson.api.RExpirableRx
clearExpire, expire, expireAt, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RObjectRx
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
-
-
-
Method Detail
-
size
io.reactivex.rxjava3.core.Single<Long> size()
Returns size of object in bytes- Returns:
- object size
-
trySet
io.reactivex.rxjava3.core.Single<Boolean> trySet(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
-
trySet
io.reactivex.rxjava3.core.Single<Boolean> trySet(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
-
setIfExists
io.reactivex.rxjava3.core.Single<Boolean> setIfExists(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
-
setIfExists
io.reactivex.rxjava3.core.Single<Boolean> setIfExists(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
-
compareAndSet
io.reactivex.rxjava3.core.Single<Boolean> compareAndSet(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.
-
getAndSet
io.reactivex.rxjava3.core.Maybe<V> getAndSet(V newValue)
Retrieves current element in the holder and replaces it withnewValue
.- Parameters:
newValue
- - value to set- Returns:
- previous value
-
getAndSet
io.reactivex.rxjava3.core.Maybe<V> getAndSet(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
-
get
io.reactivex.rxjava3.core.Maybe<V> get()
Retrieves element stored in the holder.- Returns:
- element
-
getAndDelete
io.reactivex.rxjava3.core.Maybe<V> getAndDelete()
Retrieves element in the holder and removes it.- Returns:
- element
-
set
io.reactivex.rxjava3.core.Completable set(V value)
Stores element into the holder.- Parameters:
value
- - value to set- Returns:
- void
-
set
io.reactivex.rxjava3.core.Completable set(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
-
setAndKeepTTL
io.reactivex.rxjava3.core.Completable setAndKeepTTL(V value)
Set value and keep existing TTL.Requires Redis 6.0.0 and higher.
- Parameters:
value
- - value to set- Returns:
- void
-
-