Package org.redisson
Class RedissonTimeSeries<V>
- java.lang.Object
-
- org.redisson.RedissonObject
-
- org.redisson.RedissonTimeSeries<V>
-
- All Implemented Interfaces:
Iterable<V>
,RDestroyable
,RExpirable
,RExpirableAsync
,RObject
,RObjectAsync
,RTimeSeries<V>
,RTimeSeriesAsync<V>
public class RedissonTimeSeries<V> extends RedissonObject implements RTimeSeries<V>
- Author:
- Nikita Koksharov
-
-
Field Summary
-
Fields inherited from class org.redisson.RedissonObject
codec, commandExecutor, name
-
-
Constructor Summary
Constructors Constructor Description RedissonTimeSeries(Codec codec, EvictionScheduler evictionScheduler, CommandAsyncExecutor connectionManager, String name)
RedissonTimeSeries(EvictionScheduler evictionScheduler, CommandAsyncExecutor connectionManager, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(long timestamp, V value)
Adds element to this time-series collection by specifiedtimestamp
.void
add(long timestamp, V value, long timeToLive, TimeUnit timeUnit)
Adds element to this time-series collection by specifiedtimestamp
.void
addAll(Map<Long,V> objects)
Adds all elements contained in the specified map to this time-series collection.void
addAll(Map<Long,V> objects, long timeToLive, TimeUnit timeUnit)
Adds all elements contained in the specified map to this time-series collection.RFuture<Void>
addAllAsync(Map<Long,V> objects)
Adds all elements contained in the specified map to this time-series collection.RFuture<Void>
addAllAsync(Map<Long,V> objects, long timeToLive, TimeUnit timeUnit)
Adds all elements contained in the specified map to this time-series collection.RFuture<Void>
addAsync(long timestamp, V object)
Adds element to this time-series collection by specifiedtimestamp
.RFuture<Void>
addAsync(long timestamp, V object, long timeToLive, TimeUnit timeUnit)
Adds element to this time-series collection by specifiedtimestamp
.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.protected RFuture<Boolean>
clearExpireAsync(String... keys)
RFuture<Boolean>
deleteAsync()
Delete object in async modevoid
destroy()
Destroys object when it's not necessary anymore.Collection<TimeSeriesEntry<V>>
entryRange(long startTimestamp, long endTimestamp)
Returns ordered entries of this time-series collection within timestamp range.RFuture<Collection<TimeSeriesEntry<V>>>
entryRangeAsync(boolean reverse, long startTimestamp, long endTimestamp)
RFuture<Collection<TimeSeriesEntry<V>>>
entryRangeAsync(long startTimestamp, long endTimestamp)
Returns ordered entries of this time-series collection within timestamp range.Collection<TimeSeriesEntry<V>>
entryRangeReversed(long startTimestamp, long endTimestamp)
Returns entries of this time-series collection in reverse order within timestamp range.RFuture<Collection<TimeSeriesEntry<V>>>
entryRangeReversedAsync(long startTimestamp, long endTimestamp)
Returns entries of this time-series collection in reverse order within timestamp range.boolean
expire(long timeToLive, TimeUnit timeUnit)
Set a timeout for object.boolean
expire(Instant instant)
Set an expire date for object.RFuture<Boolean>
expireAsync(long timeToLive, TimeUnit timeUnit)
Set a timeout for object in async mode.protected RFuture<Boolean>
expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)
RFuture<Boolean>
expireAsync(Instant instant)
Set an expire date for object.boolean
expireAt(long timestamp)
UseRExpirable.expire(Instant)
insteadboolean
expireAt(Date timestamp)
UseRExpirable.expire(Instant)
insteadRFuture<Boolean>
expireAtAsync(long timestamp)
UseRExpirableAsync.expireAsync(Instant)
insteadprotected RFuture<Boolean>
expireAtAsync(long timestamp, String... keys)
RFuture<Boolean>
expireAtAsync(Date timestamp)
UseRExpirableAsync.expireAsync(Instant)
insteadV
first()
Returns the head element ornull
if this time-series collection is empty.Collection<V>
first(int count)
Returns the head elements of this time-series collection.RFuture<V>
firstAsync()
Returns the head element ornull
if this time-series collection is empty.RFuture<Collection<V>>
firstAsync(int count)
Returns the head elements of this time-series collection.Long
firstTimestamp()
Returns timestamp of the head timestamp ornull
if this time-series collection is empty.RFuture<Long>
firstTimestampAsync()
Returns timestamp of the head timestamp ornull
if this time-series collection is empty.V
get(long timestamp)
Returns object by specifiedtimestamp
ornull
if it doesn't exist.RFuture<V>
getAsync(long timestamp)
Returns object by specifiedtimestamp
ornull
if it doesn't exist.Iterator<V>
iterator()
Iterator<V>
iterator(int count)
Returns an iterator over elements in this time-series collection.V
last()
Returns the tail element ornull
if this time-series collection is empty.Collection<V>
last(int count)
Returns the tail elements of this time-series collection.RFuture<V>
lastAsync()
Returns the tail element ornull
if this time-series collection is empty.RFuture<Collection<V>>
lastAsync(int count)
Returns the tail elements of this time-series collection.Long
lastTimestamp()
Returns timestamp of the tail element ornull
if this time-series collection is empty.RFuture<Long>
lastTimestampAsync()
Returns timestamp of the tail element ornull
if this time-series collection is empty.V
pollFirst()
Removes and returns the head element ornull
if this time-series collection is empty.Collection<V>
pollFirst(int count)
Removes and returns the head elements ornull
if this time-series collection is empty.RFuture<V>
pollFirstAsync()
Removes and returns the head element ornull
if this time-series collection is empty.RFuture<Collection<V>>
pollFirstAsync(int count)
Removes and returns the head elements ornull
if this time-series collection is empty.V
pollLast()
Removes and returns the tail element ornull
if this time-series collection is empty.Collection<V>
pollLast(int count)
Removes and returns the tail elements ornull
if this time-series collection is empty.RFuture<V>
pollLastAsync()
Removes and returns the tail element ornull
if this time-series collection is empty.RFuture<Collection<V>>
pollLastAsync(int count)
Removes and returns the tail elements ornull
if this time-series collection is empty.Collection<V>
range(long startTimestamp, long endTimestamp)
Returns ordered elements of this time-series collection within timestamp range.RFuture<Collection<V>>
rangeAsync(long startTimestamp, long endTimestamp)
Returns ordered elements of this time-series collection within timestamp range.Collection<V>
rangeReversed(long startTimestamp, long endTimestamp)
Returns elements of this time-series collection in reverse order within timestamp range.RFuture<Collection<V>>
rangeReversedAsync(long startTimestamp, long endTimestamp)
Returns elements of this time-series collection in reverse order within timestamp range.long
remainTimeToLive()
Remaining time to live of Redisson object that has a timeoutRFuture<Long>
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeoutboolean
remove(long timestamp)
Removes object by specifiedtimestamp
.RFuture<Boolean>
removeAsync(long timestamp)
Removes object by specifiedtimestamp
.int
removeRange(long startTimestamp, long endTimestamp)
Removes values within timestamp range.RFuture<Integer>
removeRangeAsync(long startTimestamp, long endTimestamp)
Removes values within timestamp range.ListScanResult<Object>
scanIterator(String name, RedisClient client, long startPos, int count)
RFuture<ListScanResult<Object>>
scanIteratorAsync(String name, RedisClient client, long startPos, int count)
int
size()
Returns size of this set.RFuture<Integer>
sizeAsync()
Returns size of this set.RFuture<Long>
sizeInMemoryAsync()
Returns bytes amount used by object in Redis memory.Stream<V>
stream()
Returns stream of elements in this time-series collection.Stream<V>
stream(int count)
Returns stream of elements in this time-series collection.-
Methods inherited from class org.redisson.RedissonObject
addListener, addListener, addListenerAsync, addListenerAsync, copy, copyAsync, delete, deleteAsync, dump, dumpAsync, encode, encode, encode, encode, encodeMapKey, encodeMapKeys, encodeMapValue, encodeMapValues, get, getCodec, getIdleTime, getIdleTimeAsync, getLockByMapKey, getLockByValue, getName, getRawName, getRawName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, removeListenersAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, setName, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RObject
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Methods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsync
-
-
-
-
Constructor Detail
-
RedissonTimeSeries
public RedissonTimeSeries(EvictionScheduler evictionScheduler, CommandAsyncExecutor connectionManager, String name)
-
RedissonTimeSeries
public RedissonTimeSeries(Codec codec, EvictionScheduler evictionScheduler, CommandAsyncExecutor connectionManager, String name)
-
-
Method Detail
-
add
public void add(long timestamp, V value)
Description copied from interface:RTimeSeries
Adds element to this time-series collection by specifiedtimestamp
.- Specified by:
add
in interfaceRTimeSeries<V>
- Parameters:
timestamp
- - object timestampvalue
- - object itself
-
addAsync
public RFuture<Void> addAsync(long timestamp, V object)
Description copied from interface:RTimeSeriesAsync
Adds element to this time-series collection by specifiedtimestamp
.- Specified by:
addAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
timestamp
- - object timestampobject
- - object itself- Returns:
- void
-
addAll
public void addAll(Map<Long,V> objects)
Description copied from interface:RTimeSeries
Adds all elements contained in the specified map to this time-series collection. Map contains of timestamp mapped by object.- Specified by:
addAll
in interfaceRTimeSeries<V>
- Parameters:
objects
- - map of elements to add
-
add
public void add(long timestamp, V value, long timeToLive, TimeUnit timeUnit)
Description copied from interface:RTimeSeries
Adds element to this time-series collection by specifiedtimestamp
.- Specified by:
add
in interfaceRTimeSeries<V>
- Parameters:
timestamp
- - object timestampvalue
- - object itselftimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval
-
addAsync
public RFuture<Void> addAsync(long timestamp, V object, long timeToLive, TimeUnit timeUnit)
Description copied from interface:RTimeSeriesAsync
Adds element to this time-series collection by specifiedtimestamp
.- Specified by:
addAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
timestamp
- - object timestampobject
- - object itselftimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval- Returns:
- void
-
addAll
public void addAll(Map<Long,V> objects, long timeToLive, TimeUnit timeUnit)
Description copied from interface:RTimeSeries
Adds all elements contained in the specified map to this time-series collection. Map contains of timestamp mapped by object.- Specified by:
addAll
in interfaceRTimeSeries<V>
- Parameters:
objects
- - map of elements to addtimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval
-
addAllAsync
public RFuture<Void> addAllAsync(Map<Long,V> objects)
Description copied from interface:RTimeSeriesAsync
Adds all elements contained in the specified map to this time-series collection. Map contains of timestamp mapped by object.- Specified by:
addAllAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
objects
- - map of elements to add- Returns:
- void
-
addAllAsync
public RFuture<Void> addAllAsync(Map<Long,V> objects, long timeToLive, TimeUnit timeUnit)
Description copied from interface:RTimeSeriesAsync
Adds all elements contained in the specified map to this time-series collection. Map contains of timestamp mapped by object.- Specified by:
addAllAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
objects
- - map of elements to addtimeToLive
- - time to live intervaltimeUnit
- - unit of time to live interval- Returns:
- void
-
size
public int size()
Description copied from interface:RTimeSeries
Returns size of this set.- Specified by:
size
in interfaceRTimeSeries<V>
- Returns:
- size
-
sizeAsync
public RFuture<Integer> sizeAsync()
Description copied from interface:RTimeSeriesAsync
Returns size of this set.- Specified by:
sizeAsync
in interfaceRTimeSeriesAsync<V>
- Returns:
- size
-
get
public V get(long timestamp)
Description copied from interface:RTimeSeries
Returns object by specifiedtimestamp
ornull
if it doesn't exist.- Specified by:
get
in interfaceRTimeSeries<V>
- Parameters:
timestamp
- - object timestamp- Returns:
- object
-
getAsync
public RFuture<V> getAsync(long timestamp)
Description copied from interface:RTimeSeriesAsync
Returns object by specifiedtimestamp
ornull
if it doesn't exist.- Specified by:
getAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
timestamp
- - object timestamp- Returns:
- object
-
remove
public boolean remove(long timestamp)
Description copied from interface:RTimeSeries
Removes object by specifiedtimestamp
.- Specified by:
remove
in interfaceRTimeSeries<V>
- Parameters:
timestamp
- - object timestamp- Returns:
true
if an element was removed as a result of this call
-
removeAsync
public RFuture<Boolean> removeAsync(long timestamp)
Description copied from interface:RTimeSeriesAsync
Removes object by specifiedtimestamp
.- Specified by:
removeAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
timestamp
- - object timestamp- Returns:
true
if an element was removed as a result of this call
-
last
public V last()
Description copied from interface:RTimeSeries
Returns the tail element ornull
if this time-series collection is empty.- Specified by:
last
in interfaceRTimeSeries<V>
- Returns:
- the tail element or
null
if this time-series collection is empty
-
lastAsync
public RFuture<V> lastAsync()
Description copied from interface:RTimeSeriesAsync
Returns the tail element ornull
if this time-series collection is empty.- Specified by:
lastAsync
in interfaceRTimeSeriesAsync<V>
- Returns:
- the tail element or
null
if this time-series collection is empty
-
lastAsync
public RFuture<Collection<V>> lastAsync(int count)
Description copied from interface:RTimeSeriesAsync
Returns the tail elements of this time-series collection.- Specified by:
lastAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
count
- - elements amount- Returns:
- the tail elements
-
first
public V first()
Description copied from interface:RTimeSeries
Returns the head element ornull
if this time-series collection is empty.- Specified by:
first
in interfaceRTimeSeries<V>
- Returns:
- the head element or
null
if this time-series collection is empty
-
firstAsync
public RFuture<V> firstAsync()
Description copied from interface:RTimeSeriesAsync
Returns the head element ornull
if this time-series collection is empty.- Specified by:
firstAsync
in interfaceRTimeSeriesAsync<V>
- Returns:
- the head element or
null
if this time-series collection is empty
-
firstAsync
public RFuture<Collection<V>> firstAsync(int count)
Description copied from interface:RTimeSeriesAsync
Returns the head elements of this time-series collection.- Specified by:
firstAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
count
- - elements amount- Returns:
- the head elements
-
first
public Collection<V> first(int count)
Description copied from interface:RTimeSeries
Returns the head elements of this time-series collection.- Specified by:
first
in interfaceRTimeSeries<V>
- Parameters:
count
- - elements amount- Returns:
- the head elements
-
last
public Collection<V> last(int count)
Description copied from interface:RTimeSeries
Returns the tail elements of this time-series collection.- Specified by:
last
in interfaceRTimeSeries<V>
- Parameters:
count
- - elements amount- Returns:
- the tail elements
-
firstTimestamp
public Long firstTimestamp()
Description copied from interface:RTimeSeries
Returns timestamp of the head timestamp ornull
if this time-series collection is empty.- Specified by:
firstTimestamp
in interfaceRTimeSeries<V>
- Returns:
- timestamp or
null
if this time-series collection is empty
-
firstTimestampAsync
public RFuture<Long> firstTimestampAsync()
Description copied from interface:RTimeSeriesAsync
Returns timestamp of the head timestamp ornull
if this time-series collection is empty.- Specified by:
firstTimestampAsync
in interfaceRTimeSeriesAsync<V>
- Returns:
- timestamp or
null
if this time-series collection is empty
-
lastTimestamp
public Long lastTimestamp()
Description copied from interface:RTimeSeries
Returns timestamp of the tail element ornull
if this time-series collection is empty.- Specified by:
lastTimestamp
in interfaceRTimeSeries<V>
- Returns:
- timestamp or
null
if this time-series collection is empty
-
lastTimestampAsync
public RFuture<Long> lastTimestampAsync()
Description copied from interface:RTimeSeriesAsync
Returns timestamp of the tail element ornull
if this time-series collection is empty.- Specified by:
lastTimestampAsync
in interfaceRTimeSeriesAsync<V>
- Returns:
- timestamp or
null
if this time-series collection is empty
-
removeRange
public int removeRange(long startTimestamp, long endTimestamp)
Description copied from interface:RTimeSeries
Removes values within timestamp range. Including boundary values.- Specified by:
removeRange
in interfaceRTimeSeries<V>
- Parameters:
startTimestamp
- - start timestampendTimestamp
- - end timestamp- Returns:
- number of removed elements
-
removeRangeAsync
public RFuture<Integer> removeRangeAsync(long startTimestamp, long endTimestamp)
Description copied from interface:RTimeSeriesAsync
Removes values within timestamp range. Including boundary values.- Specified by:
removeRangeAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
startTimestamp
- - start timestampendTimestamp
- - end timestamp- Returns:
- number of removed elements
-
range
public Collection<V> range(long startTimestamp, long endTimestamp)
Description copied from interface:RTimeSeries
Returns ordered elements of this time-series collection within timestamp range. Including boundary values.- Specified by:
range
in interfaceRTimeSeries<V>
- Parameters:
startTimestamp
- - start timestampendTimestamp
- - end timestamp- Returns:
- elements collection
-
entryRange
public Collection<TimeSeriesEntry<V>> entryRange(long startTimestamp, long endTimestamp)
Description copied from interface:RTimeSeries
Returns ordered entries of this time-series collection within timestamp range. Including boundary values.- Specified by:
entryRange
in interfaceRTimeSeries<V>
- Parameters:
startTimestamp
- - start timestampendTimestamp
- - end timestamp- Returns:
- elements collection
-
entryRangeReversed
public Collection<TimeSeriesEntry<V>> entryRangeReversed(long startTimestamp, long endTimestamp)
Description copied from interface:RTimeSeries
Returns entries of this time-series collection in reverse order within timestamp range. Including boundary values.- Specified by:
entryRangeReversed
in interfaceRTimeSeries<V>
- Parameters:
startTimestamp
- - start timestampendTimestamp
- - end timestamp- Returns:
- elements collection
-
entryRangeReversedAsync
public RFuture<Collection<TimeSeriesEntry<V>>> entryRangeReversedAsync(long startTimestamp, long endTimestamp)
Description copied from interface:RTimeSeriesAsync
Returns entries of this time-series collection in reverse order within timestamp range. Including boundary values.- Specified by:
entryRangeReversedAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
startTimestamp
- - start timestampendTimestamp
- - end timestamp- Returns:
- elements collection
-
entryRangeAsync
public RFuture<Collection<TimeSeriesEntry<V>>> entryRangeAsync(long startTimestamp, long endTimestamp)
Description copied from interface:RTimeSeriesAsync
Returns ordered entries of this time-series collection within timestamp range. Including boundary values.- Specified by:
entryRangeAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
startTimestamp
- - start timestampendTimestamp
- - end timestamp- Returns:
- elements collection
-
entryRangeAsync
public RFuture<Collection<TimeSeriesEntry<V>>> entryRangeAsync(boolean reverse, long startTimestamp, long endTimestamp)
-
rangeAsync
public RFuture<Collection<V>> rangeAsync(long startTimestamp, long endTimestamp)
Description copied from interface:RTimeSeriesAsync
Returns ordered elements of this time-series collection within timestamp range. Including boundary values.- Specified by:
rangeAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
startTimestamp
- - start timestampendTimestamp
- - end timestamp- Returns:
- elements collection
-
rangeReversed
public Collection<V> rangeReversed(long startTimestamp, long endTimestamp)
Description copied from interface:RTimeSeries
Returns elements of this time-series collection in reverse order within timestamp range. Including boundary values.- Specified by:
rangeReversed
in interfaceRTimeSeries<V>
- Parameters:
startTimestamp
- - start timestampendTimestamp
- - end timestamp- Returns:
- elements collection
-
rangeReversedAsync
public RFuture<Collection<V>> rangeReversedAsync(long startTimestamp, long endTimestamp)
Description copied from interface:RTimeSeriesAsync
Returns elements of this time-series collection in reverse order within timestamp range. Including boundary values.- Specified by:
rangeReversedAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
startTimestamp
- - start timestampendTimestamp
- - end timestamp- Returns:
- elements collection
-
pollFirst
public Collection<V> pollFirst(int count)
Description copied from interface:RTimeSeries
Removes and returns the head elements ornull
if this time-series collection is empty.- Specified by:
pollFirst
in interfaceRTimeSeries<V>
- Parameters:
count
- - elements amount- Returns:
- the head element,
or
null
if this time-series collection is empty
-
pollLast
public Collection<V> pollLast(int count)
Description copied from interface:RTimeSeries
Removes and returns the tail elements ornull
if this time-series collection is empty.- Specified by:
pollLast
in interfaceRTimeSeries<V>
- Parameters:
count
- - elements amount- Returns:
- the tail element or
null
if this time-series collection is empty
-
pollFirstAsync
public RFuture<Collection<V>> pollFirstAsync(int count)
Description copied from interface:RTimeSeriesAsync
Removes and returns the head elements ornull
if this time-series collection is empty.- Specified by:
pollFirstAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
count
- - elements amount- Returns:
- the head element,
or
null
if this time-series collection is empty
-
pollLastAsync
public RFuture<Collection<V>> pollLastAsync(int count)
Description copied from interface:RTimeSeriesAsync
Removes and returns the tail elements ornull
if this time-series collection is empty.- Specified by:
pollLastAsync
in interfaceRTimeSeriesAsync<V>
- Parameters:
count
- - elements amount- Returns:
- the tail element or
null
if this time-series collection is empty
-
pollFirst
public V pollFirst()
Description copied from interface:RTimeSeries
Removes and returns the head element ornull
if this time-series collection is empty.- Specified by:
pollFirst
in interfaceRTimeSeries<V>
- Returns:
- the head element,
or
null
if this time-series collection is empty
-
pollLast
public V pollLast()
Description copied from interface:RTimeSeries
Removes and returns the tail element ornull
if this time-series collection is empty.- Specified by:
pollLast
in interfaceRTimeSeries<V>
- Returns:
- the tail element or
null
if this time-series collection is empty
-
pollFirstAsync
public RFuture<V> pollFirstAsync()
Description copied from interface:RTimeSeriesAsync
Removes and returns the head element ornull
if this time-series collection is empty.- Specified by:
pollFirstAsync
in interfaceRTimeSeriesAsync<V>
- Returns:
- the head element,
or
null
if this time-series collection is empty
-
pollLastAsync
public RFuture<V> pollLastAsync()
Description copied from interface:RTimeSeriesAsync
Removes and returns the tail element ornull
if this time-series collection is empty.- Specified by:
pollLastAsync
in interfaceRTimeSeriesAsync<V>
- Returns:
- the tail element or
null
if this time-series collection is empty
-
scanIterator
public ListScanResult<Object> scanIterator(String name, RedisClient client, long startPos, int count)
-
scanIteratorAsync
public RFuture<ListScanResult<Object>> scanIteratorAsync(String name, RedisClient client, long startPos, int count)
-
iterator
public Iterator<V> iterator(int count)
Description copied from interface:RTimeSeries
Returns an iterator over elements in this time-series collection. Elements are loaded in batch. Batch size is defined bycount
param.- Specified by:
iterator
in interfaceRTimeSeries<V>
- Parameters:
count
- - size of elements batch- Returns:
- iterator
-
stream
public Stream<V> stream()
Description copied from interface:RTimeSeries
Returns stream of elements in this time-series collection. Elements are loaded in batch. Batch size is 10.- Specified by:
stream
in interfaceRTimeSeries<V>
- Returns:
- stream of elements
-
stream
public Stream<V> stream(int count)
Description copied from interface:RTimeSeries
Returns stream of elements in this time-series collection. Elements are loaded in batch. Batch size is defined bycount
param.- Specified by:
stream
in interfaceRTimeSeries<V>
- Parameters:
count
- - size of elements batch- Returns:
- stream of elements
-
destroy
public void destroy()
Description copied from interface:RDestroyable
Destroys object when it's not necessary anymore.- Specified by:
destroy
in interfaceRDestroyable
-
deleteAsync
public RFuture<Boolean> deleteAsync()
Description copied from interface:RObjectAsync
Delete object in async mode- Specified by:
deleteAsync
in interfaceRObjectAsync
- Overrides:
deleteAsync
in classRedissonObject
- Returns:
true
if object was deletedfalse
if not
-
expireAsync
public RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit)
Description copied from interface:RExpirableAsync
Set a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
clearExpireAsync
public RFuture<Boolean> clearExpireAsync()
Description copied from interface:RExpirableAsync
Clear an expire timeout or expire date for object in async mode. Object will not be deleted.- Specified by:
clearExpireAsync
in interfaceRExpirableAsync
- Returns:
true
if the timeout was cleared andfalse
if not
-
sizeInMemoryAsync
public RFuture<Long> sizeInMemoryAsync()
Description copied from interface:RObjectAsync
Returns bytes amount used by object in Redis memory.- Specified by:
sizeInMemoryAsync
in interfaceRObjectAsync
- Overrides:
sizeInMemoryAsync
in classRedissonObject
- Returns:
- size in bytes
-
expire
public boolean expire(long timeToLive, TimeUnit timeUnit)
Description copied from interface:RExpirable
Set a timeout for object. After the timeout has expired, the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
timeToLive
- - timeout before object will be deletedtimeUnit
- - timeout time unit- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(long timestamp)
Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(long timestamp)
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date in milliseconds (Unix timestamp)- Returns:
true
if the timeout was set andfalse
if not
-
expire
public boolean expire(Instant instant)
Description copied from interface:RExpirable
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expire
in interfaceRExpirable
- Parameters:
instant
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAsync
public RFuture<Boolean> expireAsync(Instant instant)
Description copied from interface:RExpirableAsync
Set an expire date for object. When expire date comes the key will automatically be deleted.- Specified by:
expireAsync
in interfaceRExpirableAsync
- Parameters:
instant
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAt
public boolean expireAt(Date timestamp)
Description copied from interface:RExpirable
UseRExpirable.expire(Instant)
instead- Specified by:
expireAt
in interfaceRExpirable
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
expireAtAsync
public RFuture<Boolean> expireAtAsync(Date timestamp)
Description copied from interface:RExpirableAsync
UseRExpirableAsync.expireAsync(Instant)
instead- Specified by:
expireAtAsync
in interfaceRExpirableAsync
- Parameters:
timestamp
- - expire date- Returns:
true
if the timeout was set andfalse
if not
-
clearExpire
public boolean clearExpire()
Description copied from interface:RExpirable
Clear an expire timeout or expire date for object.- Specified by:
clearExpire
in interfaceRExpirable
- Returns:
true
if timeout was removedfalse
if object does not exist or does not have an associated timeout
-
remainTimeToLive
public long remainTimeToLive()
Description copied from interface:RExpirable
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLive
in interfaceRExpirable
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
remainTimeToLiveAsync
public RFuture<Long> remainTimeToLiveAsync()
Description copied from interface:RExpirableAsync
Remaining time to live of Redisson object that has a timeout- Specified by:
remainTimeToLiveAsync
in interfaceRExpirableAsync
- Returns:
- time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-
expireAsync
protected RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)
-
-