public class RedissonTimeSeries<V> extends RedissonObject implements RTimeSeries<V>
codec, commandExecutor, name
Constructor and Description |
---|
RedissonTimeSeries(Codec codec,
EvictionScheduler evictionScheduler,
CommandAsyncExecutor connectionManager,
String name) |
RedissonTimeSeries(EvictionScheduler evictionScheduler,
CommandAsyncExecutor connectionManager,
String name) |
Modifier and Type | Method and Description |
---|---|
void |
add(long timestamp,
V value)
Adds element to this time-series collection
by specified
timestamp . |
void |
add(long timestamp,
V value,
long timeToLive,
TimeUnit timeUnit)
Adds element to this time-series collection
by specified
timestamp . |
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 specified
timestamp . |
RFuture<Void> |
addAsync(long timestamp,
V object,
long timeToLive,
TimeUnit timeUnit)
Adds element to this time-series collection
by specified
timestamp . |
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 mode
|
void |
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.
|
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) |
boolean |
expireAt(Date timestamp)
Set an expire date for object.
|
boolean |
expireAt(long timestamp)
Set an expire date for object.
|
RFuture<Boolean> |
expireAtAsync(Date timestamp)
Set an expire date for object in async mode.
|
RFuture<Boolean> |
expireAtAsync(long timestamp)
Set an expire date for object in async mode.
|
protected RFuture<Boolean> |
expireAtAsync(long timestamp,
String... keys) |
V |
first()
Returns the head element or
null 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 or
null 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 or
null if this time-series collection is empty. |
RFuture<Long> |
firstTimestampAsync()
Returns timestamp of the head timestamp or
null if this time-series collection is empty. |
V |
get(long timestamp)
Returns object by specified
timestamp or null if it doesn't exist. |
RFuture<V> |
getAsync(long timestamp)
Returns object by specified
timestamp or null 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 or
null 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 or
null 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 or
null if this time-series collection is empty. |
RFuture<Long> |
lastTimestampAsync()
Returns timestamp of the tail element or
null if this time-series collection is empty. |
V |
pollFirst()
Removes and returns the head element or
null if this time-series collection is empty. |
Collection<V> |
pollFirst(int count)
Removes and returns the head elements or
null if this time-series collection is empty. |
RFuture<V> |
pollFirstAsync()
Removes and returns the head element or
null if this time-series collection is empty. |
RFuture<Collection<V>> |
pollFirstAsync(int count)
Removes and returns the head elements or
null if this time-series collection is empty. |
V |
pollLast()
Removes and returns the tail element or
null if this time-series collection is empty. |
Collection<V> |
pollLast(int count)
Removes and returns the tail elements or
null if this time-series collection is empty. |
RFuture<V> |
pollLastAsync()
Removes and returns the tail element or
null if this time-series collection is empty. |
RFuture<Collection<V>> |
pollLastAsync(int count)
Removes and returns the tail elements or
null 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 timeout
|
RFuture<Long> |
remainTimeToLiveAsync()
Remaining time to live of Redisson object that has a timeout
|
boolean |
remove(long timestamp)
Removes object by specified
timestamp . |
RFuture<Boolean> |
removeAsync(long timestamp)
Removes object by specified
timestamp . |
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.
|
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, getName, isExists, isExistsAsync, migrate, migrateAsync, move, moveAsync, prefixName, removeListener, removeListenerAsync, removeListenersAsync, rename, renameAsync, renamenx, renamenxAsync, restore, restore, restoreAndReplace, restoreAndReplace, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemory, sizeInMemoryAsync, sizeInMemoryAsync, suffixName, toSeconds, toStream, touch, touchAsync, unlink, unlinkAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearExpire, expire, expireAt, expireAt, remainTimeToLive
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
forEach, spliterator
expireAtAsync, remainTimeToLiveAsync
addListenerAsync, copyAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, touchAsync, unlinkAsync
public RedissonTimeSeries(EvictionScheduler evictionScheduler, CommandAsyncExecutor connectionManager, String name)
public RedissonTimeSeries(Codec codec, EvictionScheduler evictionScheduler, CommandAsyncExecutor connectionManager, String name)
public void add(long timestamp, V value)
RTimeSeries
timestamp
.add
in interface RTimeSeries<V>
timestamp
- - object timestampvalue
- - object itselfpublic RFuture<Void> addAsync(long timestamp, V object)
RTimeSeriesAsync
timestamp
.addAsync
in interface RTimeSeriesAsync<V>
timestamp
- - object timestampobject
- - object itselfpublic void addAll(Map<Long,V> objects)
RTimeSeries
addAll
in interface RTimeSeries<V>
objects
- - map of elements to addpublic void add(long timestamp, V value, long timeToLive, TimeUnit timeUnit)
RTimeSeries
timestamp
.add
in interface RTimeSeries<V>
timestamp
- - object timestampvalue
- - object itselftimeToLive
- - time to live intervaltimeUnit
- - unit of time to live intervalpublic RFuture<Void> addAsync(long timestamp, V object, long timeToLive, TimeUnit timeUnit)
RTimeSeriesAsync
timestamp
.addAsync
in interface RTimeSeriesAsync<V>
timestamp
- - object timestampobject
- - object itselftimeToLive
- - time to live intervaltimeUnit
- - unit of time to live intervalpublic void addAll(Map<Long,V> objects, long timeToLive, TimeUnit timeUnit)
RTimeSeries
addAll
in interface RTimeSeries<V>
objects
- - map of elements to addtimeToLive
- - time to live intervaltimeUnit
- - unit of time to live intervalpublic RFuture<Void> addAllAsync(Map<Long,V> objects)
RTimeSeriesAsync
addAllAsync
in interface RTimeSeriesAsync<V>
objects
- - map of elements to addpublic RFuture<Void> addAllAsync(Map<Long,V> objects, long timeToLive, TimeUnit timeUnit)
RTimeSeriesAsync
addAllAsync
in interface RTimeSeriesAsync<V>
objects
- - map of elements to addtimeToLive
- - time to live intervaltimeUnit
- - unit of time to live intervalpublic int size()
RTimeSeries
size
in interface RTimeSeries<V>
public RFuture<Integer> sizeAsync()
RTimeSeriesAsync
sizeAsync
in interface RTimeSeriesAsync<V>
public V get(long timestamp)
RTimeSeries
timestamp
or null
if it doesn't exist.get
in interface RTimeSeries<V>
timestamp
- - object timestamppublic RFuture<V> getAsync(long timestamp)
RTimeSeriesAsync
timestamp
or null
if it doesn't exist.getAsync
in interface RTimeSeriesAsync<V>
timestamp
- - object timestamppublic boolean remove(long timestamp)
RTimeSeries
timestamp
.remove
in interface RTimeSeries<V>
timestamp
- - object timestamptrue
if an element was removed as a result of this callpublic RFuture<Boolean> removeAsync(long timestamp)
RTimeSeriesAsync
timestamp
.removeAsync
in interface RTimeSeriesAsync<V>
timestamp
- - object timestamptrue
if an element was removed as a result of this callpublic V last()
RTimeSeries
null
if this time-series collection is empty.last
in interface RTimeSeries<V>
null
if this time-series collection is emptypublic RFuture<V> lastAsync()
RTimeSeriesAsync
null
if this time-series collection is empty.lastAsync
in interface RTimeSeriesAsync<V>
null
if this time-series collection is emptypublic RFuture<Collection<V>> lastAsync(int count)
RTimeSeriesAsync
lastAsync
in interface RTimeSeriesAsync<V>
count
- - elements amountpublic V first()
RTimeSeries
null
if this time-series collection is empty.first
in interface RTimeSeries<V>
null
if this time-series collection is emptypublic RFuture<V> firstAsync()
RTimeSeriesAsync
null
if this time-series collection is empty.firstAsync
in interface RTimeSeriesAsync<V>
null
if this time-series collection is emptypublic RFuture<Collection<V>> firstAsync(int count)
RTimeSeriesAsync
firstAsync
in interface RTimeSeriesAsync<V>
count
- - elements amountpublic Collection<V> first(int count)
RTimeSeries
first
in interface RTimeSeries<V>
count
- - elements amountpublic Collection<V> last(int count)
RTimeSeries
last
in interface RTimeSeries<V>
count
- - elements amountpublic Long firstTimestamp()
RTimeSeries
null
if this time-series collection is empty.firstTimestamp
in interface RTimeSeries<V>
null
if this time-series collection is emptypublic RFuture<Long> firstTimestampAsync()
RTimeSeriesAsync
null
if this time-series collection is empty.firstTimestampAsync
in interface RTimeSeriesAsync<V>
null
if this time-series collection is emptypublic Long lastTimestamp()
RTimeSeries
null
if this time-series collection is empty.lastTimestamp
in interface RTimeSeries<V>
null
if this time-series collection is emptypublic RFuture<Long> lastTimestampAsync()
RTimeSeriesAsync
null
if this time-series collection is empty.lastTimestampAsync
in interface RTimeSeriesAsync<V>
null
if this time-series collection is emptypublic int removeRange(long startTimestamp, long endTimestamp)
RTimeSeries
removeRange
in interface RTimeSeries<V>
startTimestamp
- - start timestampendTimestamp
- - end timestamppublic RFuture<Integer> removeRangeAsync(long startTimestamp, long endTimestamp)
RTimeSeriesAsync
removeRangeAsync
in interface RTimeSeriesAsync<V>
startTimestamp
- - start timestampendTimestamp
- - end timestamppublic Collection<V> range(long startTimestamp, long endTimestamp)
RTimeSeries
range
in interface RTimeSeries<V>
startTimestamp
- - start timestampendTimestamp
- - end timestamppublic Collection<TimeSeriesEntry<V>> entryRange(long startTimestamp, long endTimestamp)
RTimeSeries
entryRange
in interface RTimeSeries<V>
startTimestamp
- - start timestampendTimestamp
- - end timestamppublic Collection<TimeSeriesEntry<V>> entryRangeReversed(long startTimestamp, long endTimestamp)
RTimeSeries
entryRangeReversed
in interface RTimeSeries<V>
startTimestamp
- - start timestampendTimestamp
- - end timestamppublic RFuture<Collection<TimeSeriesEntry<V>>> entryRangeReversedAsync(long startTimestamp, long endTimestamp)
RTimeSeriesAsync
entryRangeReversedAsync
in interface RTimeSeriesAsync<V>
startTimestamp
- - start timestampendTimestamp
- - end timestamppublic RFuture<Collection<TimeSeriesEntry<V>>> entryRangeAsync(long startTimestamp, long endTimestamp)
RTimeSeriesAsync
entryRangeAsync
in interface RTimeSeriesAsync<V>
startTimestamp
- - start timestampendTimestamp
- - end timestamppublic RFuture<Collection<TimeSeriesEntry<V>>> entryRangeAsync(boolean reverse, long startTimestamp, long endTimestamp)
public RFuture<Collection<V>> rangeAsync(long startTimestamp, long endTimestamp)
RTimeSeriesAsync
rangeAsync
in interface RTimeSeriesAsync<V>
startTimestamp
- - start timestampendTimestamp
- - end timestamppublic Collection<V> rangeReversed(long startTimestamp, long endTimestamp)
RTimeSeries
rangeReversed
in interface RTimeSeries<V>
startTimestamp
- - start timestampendTimestamp
- - end timestamppublic RFuture<Collection<V>> rangeReversedAsync(long startTimestamp, long endTimestamp)
RTimeSeriesAsync
rangeReversedAsync
in interface RTimeSeriesAsync<V>
startTimestamp
- - start timestampendTimestamp
- - end timestamppublic Collection<V> pollFirst(int count)
RTimeSeries
null
if this time-series collection is empty.pollFirst
in interface RTimeSeries<V>
count
- - elements amountnull
if this time-series collection is emptypublic Collection<V> pollLast(int count)
RTimeSeries
null
if this time-series collection is empty.pollLast
in interface RTimeSeries<V>
count
- - elements amountnull
if this time-series collection is emptypublic RFuture<Collection<V>> pollFirstAsync(int count)
RTimeSeriesAsync
null
if this time-series collection is empty.pollFirstAsync
in interface RTimeSeriesAsync<V>
count
- - elements amountnull
if this time-series collection is emptypublic RFuture<Collection<V>> pollLastAsync(int count)
RTimeSeriesAsync
null
if this time-series collection is empty.pollLastAsync
in interface RTimeSeriesAsync<V>
count
- - elements amountnull
if this time-series collection is emptypublic V pollFirst()
RTimeSeries
null
if this time-series collection is empty.pollFirst
in interface RTimeSeries<V>
null
if this time-series collection is emptypublic V pollLast()
RTimeSeries
null
if this time-series collection is empty.pollLast
in interface RTimeSeries<V>
null
if this time-series collection is emptypublic RFuture<V> pollFirstAsync()
RTimeSeriesAsync
null
if this time-series collection is empty.pollFirstAsync
in interface RTimeSeriesAsync<V>
null
if this time-series collection is emptypublic RFuture<V> pollLastAsync()
RTimeSeriesAsync
null
if this time-series collection is empty.pollLastAsync
in interface RTimeSeriesAsync<V>
null
if this time-series collection is emptypublic ListScanResult<Object> scanIterator(String name, RedisClient client, long startPos, int count)
public RFuture<ListScanResult<Object>> scanIteratorAsync(String name, RedisClient client, long startPos, int count)
public Iterator<V> iterator(int count)
RTimeSeries
count
param.iterator
in interface RTimeSeries<V>
count
- - size of elements batchpublic Stream<V> stream()
RTimeSeries
stream
in interface RTimeSeries<V>
public Stream<V> stream(int count)
RTimeSeries
count
param.stream
in interface RTimeSeries<V>
count
- - size of elements batchpublic void destroy()
RDestroyable
destroy
in interface RDestroyable
public RFuture<Boolean> deleteAsync()
RObjectAsync
deleteAsync
in interface RObjectAsync
deleteAsync
in class RedissonObject
true
if object was deleted false
if notpublic 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(long timestamp)
RExpirableAsync
expireAtAsync
in interface RExpirableAsync
timestamp
- - expire date in milliseconds (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<Long> sizeInMemoryAsync()
RObjectAsync
sizeInMemoryAsync
in interface RObjectAsync
sizeInMemoryAsync
in class RedissonObject
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 RFuture<Boolean> expireAtAsync(Date timestamp)
RExpirableAsync
expireAtAsync
in interface RExpirableAsync
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
protected RFuture<Boolean> expireAsync(long timeToLive, TimeUnit timeUnit, String... keys)
Copyright © 2014–2020 Redisson. All rights reserved.