Package org.redisson.api
Interface RTimeSeries<V,L>
- Type Parameters:
V- value typeL- label type
- All Superinterfaces:
Iterable<V>,RDestroyable,RExpirable,RExpirableAsync,RObject,RObjectAsync,RTimeSeriesAsync<V,L>
- All Known Implementing Classes:
RedissonTimeSeries
public interface RTimeSeries<V,L>
extends RExpirable, Iterable<V>, RTimeSeriesAsync<V,L>, RDestroyable
Redis based time-series collection.
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds element to this time-series collection by specifiedtimestamp.voidAdds element to this time-series collection by specifiedtimestamp.voidAdds element withlabelto this time-series collection by specifiedtimestamp.voidAdds element withlabelto this time-series collection by specifiedtimestamp.voidaddAll(Collection<TimeSeriesEntry<V, L>> entries) Adds all entries collection to this time-series collection.voidaddAll(Collection<TimeSeriesEntry<V, L>> entries, Duration timeToLive) Adds all time series entries collection to this time-series collection.voidAdds all elements contained in the specified map to this time-series collection.voidAdds all elements contained in the specified map to this time-series collection.entryRange(long startTimestamp, long endTimestamp) Returns ordered entries of this time-series collection within timestamp range.entryRange(long startTimestamp, long endTimestamp, int limit) Returns ordered entries of this time-series collection within timestamp range.entryRangeReversed(long startTimestamp, long endTimestamp) Returns entries of this time-series collection in reverse order within timestamp range.entryRangeReversed(long startTimestamp, long endTimestamp, int limit) Returns entries of this time-series collection in reverse order within timestamp range.first()Returns the head element ornullif this time-series collection is empty.first(int count) Returns the head elements of this time-series collection.firstEntries(int count) Returns the head entries of this time-series collection.Returns the head entry ornullif this time-series collection is empty.Returns timestamp of the head timestamp ornullif this time-series collection is empty.get(long timestamp) Returns object by specifiedtimestampornullif it doesn't exist.getAndRemove(long timestamp) Removes and returns object by specifiedtimestamp.getAndRemoveEntry(long timestamp) Removes and returns entry by specifiedtimestamp.getEntry(long timestamp) Returns time series entry by specifiedtimestampornullif it doesn't exist.iterator(int count) Returns an iterator over elements in this time-series collection.last()Returns the tail element ornullif this time-series collection is empty.last(int count) Returns the tail elements of this time-series collection.lastEntries(int count) Returns the tail entries of this time-series collection.Returns the tail entry ornullif this time-series collection is empty.Returns timestamp of the tail element ornullif this time-series collection is empty.Removes and returns the head element ornullif this time-series collection is empty.pollFirst(int count) Removes and returns the head elementspollFirstEntries(int count) Removes and returns head entriesRemoves and returns head entry ornullif this time-series collection is empty.pollLast()Removes and returns the tail element ornullif this time-series collection is empty.pollLast(int count) Removes and returns the tail elements ornullif this time-series collection is empty.pollLastEntries(int count) Removes and returns tail entriesRemoves and returns the tail entry ornullif this time-series collection is empty.range(long startTimestamp, long endTimestamp) Returns ordered elements of this time-series collection within timestamp range.range(long startTimestamp, long endTimestamp, int limit) Returns ordered elements of this time-series collection within timestamp range.rangeReversed(long startTimestamp, long endTimestamp) Returns elements of this time-series collection in reverse order within timestamp range.rangeReversed(long startTimestamp, long endTimestamp, int limit) Returns elements of this time-series collection in reverse order within timestamp range.booleanremove(long timestamp) Removes object by specifiedtimestamp.intremoveRange(long startTimestamp, long endTimestamp) Removes values within timestamp range.intsize()Returns size of this set.stream()Returns stream of elements in this time-series collection.stream(int count) Returns stream of elements in this time-series collection.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.redisson.api.RDestroyable
destroyMethods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods 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, unlinkMethods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsyncMethods inherited from interface org.redisson.api.RTimeSeriesAsync
addAllAsync, addAllAsync, addAllAsync, addAllAsync, addAsync, addAsync, addAsync, addAsync, entryRangeAsync, entryRangeAsync, entryRangeReversedAsync, entryRangeReversedAsync, firstAsync, firstAsync, firstEntriesAsync, firstEntryAsync, firstTimestampAsync, getAndRemoveAsync, getAndRemoveEntryAsync, getAsync, getEntryAsync, lastAsync, lastAsync, lastEntriesAsync, lastEntryAsync, lastTimestampAsync, pollFirstAsync, pollFirstAsync, pollFirstEntriesAsync, pollFirstEntryAsync, pollLastAsync, pollLastAsync, pollLastEntriesAsync, pollLastEntryAsync, rangeAsync, rangeAsync, rangeReversedAsync, rangeReversedAsync, removeAsync, removeRangeAsync, sizeAsync
-
Method Details
-
add
Adds element to this time-series collection by specifiedtimestamp.- Parameters:
timestamp- object timestampobject- object itself
-
add
Adds element withlabelto this time-series collection by specifiedtimestamp.- Parameters:
timestamp- object timestampobject- object itselflabel- object label
-
addAll
Adds all elements contained in the specified map to this time-series collection. Map contains of timestamp mapped by object.- Parameters:
objects- - map of elements to add
-
addAll
Adds all entries collection to this time-series collection.- Parameters:
entries- collection of time series entries
-
add
Adds element to this time-series collection by specifiedtimestamp.- Parameters:
timestamp- - object timestampobject- - object itselftimeToLive- - time to live intervaltimeUnit- - unit of time to live interval
-
add
Adds element withlabelto this time-series collection by specifiedtimestamp.- Parameters:
timestamp- object timestampobject- object itselflabel- object labeltimeToLive- time to live interval
-
addAll
Adds all elements contained in the specified map to this time-series collection. Map contains of timestamp mapped by object.- Parameters:
objects- - map of elements to addtimeToLive- - time to live intervaltimeUnit- - unit of time to live interval
-
addAll
Adds all time series entries collection to this time-series collection. Specified time to live interval applied to all entries defined in collection.- Parameters:
entries- collection of time series entriestimeToLive- time to live interval
-
size
int size()Returns size of this set.- Returns:
- size
-
get
Returns object by specifiedtimestampornullif it doesn't exist.- Parameters:
timestamp- - object timestamp- Returns:
- object
-
getEntry
Returns time series entry by specifiedtimestampornullif it doesn't exist.- Parameters:
timestamp- object timestamp- Returns:
- time series entry
-
remove
boolean remove(long timestamp) Removes object by specifiedtimestamp.- Parameters:
timestamp- - object timestamp- Returns:
trueif an element was removed as a result of this call
-
getAndRemove
Removes and returns object by specifiedtimestamp.- Parameters:
timestamp- - object timestamp- Returns:
- object or
nullif it doesn't exist
-
getAndRemoveEntry
Removes and returns entry by specifiedtimestamp.- Parameters:
timestamp- - object timestamp- Returns:
- entry or
nullif it doesn't exist
-
pollFirst
Removes and returns the head elements- Parameters:
count- - elements amount- Returns:
- collection of head elements
-
pollFirstEntries
Removes and returns head entries- Parameters:
count- - entries amount- Returns:
- collection of head entries
-
pollLast
Removes and returns the tail elements ornullif this time-series collection is empty.- Parameters:
count- - elements amount- Returns:
- the tail element or
nullif this time-series collection is empty
-
pollLastEntries
Removes and returns tail entries- Parameters:
count- - entries amount- Returns:
- collection of tail entries
-
pollFirst
V pollFirst()Removes and returns the head element ornullif this time-series collection is empty.- Returns:
- the head element,
or
nullif this time-series collection is empty
-
pollFirstEntry
TimeSeriesEntry<V,L> pollFirstEntry()Removes and returns head entry ornullif this time-series collection is empty.- Returns:
- the head entry,
or
nullif this time-series collection is empty
-
pollLast
V pollLast()Removes and returns the tail element ornullif this time-series collection is empty.- Returns:
- the tail element or
nullif this time-series collection is empty
-
pollLastEntry
TimeSeriesEntry<V,L> pollLastEntry()Removes and returns the tail entry ornullif this time-series collection is empty.- Returns:
- the tail entry or
nullif this time-series collection is empty
-
last
V last()Returns the tail element ornullif this time-series collection is empty.- Returns:
- the tail element or
nullif this time-series collection is empty
-
lastEntry
TimeSeriesEntry<V,L> lastEntry()Returns the tail entry ornullif this time-series collection is empty.- Returns:
- the tail entry or
nullif this time-series collection is empty
-
first
V first()Returns the head element ornullif this time-series collection is empty.- Returns:
- the head element or
nullif this time-series collection is empty
-
firstEntry
TimeSeriesEntry<V,L> firstEntry()Returns the head entry ornullif this time-series collection is empty.- Returns:
- the head entry or
nullif this time-series collection is empty
-
firstTimestamp
Long firstTimestamp()Returns timestamp of the head timestamp ornullif this time-series collection is empty.- Returns:
- timestamp or
nullif this time-series collection is empty
-
lastTimestamp
Long lastTimestamp()Returns timestamp of the tail element ornullif this time-series collection is empty.- Returns:
- timestamp or
nullif this time-series collection is empty
-
last
Returns the tail elements of this time-series collection.- Parameters:
count- - elements amount- Returns:
- the tail elements
-
lastEntries
Returns the tail entries of this time-series collection.- Parameters:
count- - entries amount- Returns:
- the tail entries
-
first
Returns the head elements of this time-series collection.- Parameters:
count- - elements amount- Returns:
- the head elements
-
firstEntries
Returns the head entries of this time-series collection.- Parameters:
count- - entries amount- Returns:
- the head entries
-
removeRange
int removeRange(long startTimestamp, long endTimestamp) Removes values within timestamp range. Including boundary values.- Parameters:
startTimestamp- - start timestampendTimestamp- - end timestamp- Returns:
- number of removed elements
-
range
Returns ordered elements of this time-series collection within timestamp range. Including boundary values.- Parameters:
startTimestamp- - start timestampendTimestamp- - end timestamp- Returns:
- elements collection
-
range
Returns ordered elements of this time-series collection within timestamp range. Including boundary values.- Parameters:
startTimestamp- start timestampendTimestamp- end timestamplimit- result size limit- Returns:
- elements collection
-
rangeReversed
Returns elements of this time-series collection in reverse order within timestamp range. Including boundary values.- Parameters:
startTimestamp- - start timestampendTimestamp- - end timestamp- Returns:
- elements collection
-
rangeReversed
Returns elements of this time-series collection in reverse order within timestamp range. Including boundary values.- Parameters:
startTimestamp- start timestampendTimestamp- end timestamplimit- result size limit- Returns:
- elements collection
-
entryRange
Returns ordered entries of this time-series collection within timestamp range. Including boundary values.- Parameters:
startTimestamp- - start timestampendTimestamp- - end timestamp- Returns:
- elements collection
-
entryRange
Returns ordered entries of this time-series collection within timestamp range. Including boundary values.- Parameters:
startTimestamp- start timestampendTimestamp- end timestamplimit- result size limit- Returns:
- elements collection
-
entryRangeReversed
Returns entries of this time-series collection in reverse order within timestamp range. Including boundary values.- Parameters:
startTimestamp- - start timestampendTimestamp- - end timestamp- Returns:
- elements collection
-
entryRangeReversed
Collection<TimeSeriesEntry<V,L>> entryRangeReversed(long startTimestamp, long endTimestamp, int limit) Returns entries of this time-series collection in reverse order within timestamp range. Including boundary values.- Parameters:
startTimestamp- start timestampendTimestamp- end timestamplimit- result size limit- Returns:
- elements collection
-
stream
Returns stream of elements in this time-series collection. Elements are loaded in batch. Batch size is 10.- Returns:
- stream of elements
-
stream
Returns stream of elements in this time-series collection. Elements are loaded in batch. Batch size is defined bycountparam.- Parameters:
count- - size of elements batch- Returns:
- stream of elements
-
iterator
Returns an iterator over elements in this time-series collection. Elements are loaded in batch. Batch size is defined bycountparam.- Parameters:
count- - size of elements batch- Returns:
- iterator
-