Package org.redisson.api
Interface RBucketRx<V>
- Type Parameters:
V
- - the type of object
- All Superinterfaces:
RExpirableRx
,RObjectRx
- All Known Subinterfaces:
RBinaryStreamRx
,RJsonBucketRx<V>
Reactive implementation of object holder. Max size of object is 512MB
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionio.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> Retrieves current element in the holder and clears expiration date set before.io.reactivex.rxjava3.core.Maybe
<V> Retrieves element in the holder and removes it.io.reactivex.rxjava3.core.Maybe
<V> getAndExpire
(Duration duration) Retrieves current element in the holder and sets an expiration duration for it.io.reactivex.rxjava3.core.Maybe
<V> getAndExpire
(Instant time) Retrieves current element in the holder and sets an expiration date for it.io.reactivex.rxjava3.core.Maybe
<V> Retrieves current element in the holder and replaces it withnewValue
.io.reactivex.rxjava3.core.Maybe
<V> Deprecated.io.reactivex.rxjava3.core.Maybe
<V> Retrieves current element in the holder and replaces it withvalue
with defined expirationduration
.io.reactivex.rxjava3.core.Completable
Stores element into the holder.io.reactivex.rxjava3.core.Completable
Deprecated.io.reactivex.rxjava3.core.Completable
Storesvalue
into the holder with defined expirationduration
.io.reactivex.rxjava3.core.Completable
setAndKeepTTL
(V value) Set value and keep existing TTL.io.reactivex.rxjava3.core.Single
<Boolean> setIfAbsent
(V value) Sets value only if object holder doesn't exist.io.reactivex.rxjava3.core.Single
<Boolean> setIfAbsent
(V value, Duration duration) Sets value with defined duration only if object holder doesn't exist.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) Deprecated.io.reactivex.rxjava3.core.Single
<Boolean> setIfExists
(V value, Duration duration) Setsvalue
with expirationduration
only if object holder already exists.io.reactivex.rxjava3.core.Single
<Long> size()
Returns size of object in bytesio.reactivex.rxjava3.core.Single
<Boolean> Deprecated.io.reactivex.rxjava3.core.Single
<Boolean> Deprecated.Methods inherited from interface org.redisson.api.RExpirableRx
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, 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 Details
-
size
io.reactivex.rxjava3.core.Single<Long> size()Returns size of object in bytes- Returns:
- object size
-
setIfAbsent
Sets value only if object holder doesn't exist.- Parameters:
value
- - value to set- Returns:
true
if successful, orfalse
if element was already set
-
setIfAbsent
Sets value with defined duration only if object holder doesn't exist.- Parameters:
value
- value to setduration
- expiration duration- Returns:
true
if successful, orfalse
if element was already set
-
trySet
Deprecated.UsesetIfAbsent(Object)
instead- Parameters:
value
- - value to set- Returns:
true
if successful, orfalse
if element was already set
-
trySet
@Deprecated io.reactivex.rxjava3.core.Single<Boolean> trySet(V value, long timeToLive, TimeUnit timeUnit) Deprecated.UsesetIfAbsent(Object, Duration)
instead- 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
Sets value only if it's already exists.- Parameters:
value
- - value to set- Returns:
true
if successful, orfalse
if element wasn't set
-
setIfExists
@Deprecated io.reactivex.rxjava3.core.Single<Boolean> setIfExists(V value, long timeToLive, TimeUnit timeUnit) Deprecated.UsesetIfExists(Object, Duration)
instead- 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
-
setIfExists
Setsvalue
with expirationduration
only if object holder already exists.- Parameters:
value
- value to setduration
- expiration duration- Returns:
true
if successful, orfalse
if element wasn't set
-
compareAndSet
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
Retrieves current element in the holder and replaces it withnewValue
.- Parameters:
newValue
- - value to set- Returns:
- previous value
-
getAndSet
@Deprecated io.reactivex.rxjava3.core.Maybe<V> getAndSet(V value, long timeToLive, TimeUnit timeUnit) Deprecated.UsegetAndSet(Object, Duration)
instead- Parameters:
value
- - value to settimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval- Returns:
- previous value
-
getAndSet
Retrieves current element in the holder and replaces it withvalue
with defined expirationduration
.- Parameters:
value
- value to setduration
- expiration duration- Returns:
- previous value
-
getAndExpire
Retrieves current element in the holder and sets an expiration duration for it.Requires Redis 6.2.0 and higher.
- Parameters:
duration
- of object time to live interval- Returns:
- element
-
getAndExpire
Retrieves current element in the holder and sets an expiration date for it.Requires Redis 6.2.0 and higher.
- Parameters:
time
- of exact object expiration moment- Returns:
- element
-
getAndClearExpire
io.reactivex.rxjava3.core.Maybe<V> getAndClearExpire()Retrieves current element in the holder and clears expiration date set before.Requires Redis 6.2.0 and higher.
- Returns:
- element
-
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
Stores element into the holder.- Parameters:
value
- - value to set- Returns:
- void
-
set
Deprecated.Useset(Object, Duration)
instead- Parameters:
value
- - value to settimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval- Returns:
- void
-
set
Storesvalue
into the holder with defined expirationduration
.- Parameters:
value
- value to setduration
- expiration duration
-
setAndKeepTTL
Set value and keep existing TTL.Requires Redis 6.0.0 and higher.
- Parameters:
value
- - value to set- Returns:
- void
-