Package org.redisson.api
Interface RTimeSeriesReactive<V>
-
- All Superinterfaces:
RExpirableReactive
,RObjectReactive
public interface RTimeSeriesReactive<V> extends RExpirableReactive
Reactive interface for Redis based time-series collection.- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description reactor.core.publisher.Mono<Void>
add(long timestamp, V object)
Adds element to this time-series collection by specifiedtimestamp
.reactor.core.publisher.Mono<Void>
add(long timestamp, V object, long timeToLive, TimeUnit timeUnit)
Adds element to this time-series collection by specifiedtimestamp
.reactor.core.publisher.Mono<Void>
addAll(Map<Long,V> objects)
Adds all elements contained in the specified map to this time-series collection.reactor.core.publisher.Mono<Void>
addAll(Map<Long,V> objects, long timeToLive, TimeUnit timeUnit)
Adds all elements contained in the specified map to this time-series collection.reactor.core.publisher.Mono<Collection<TimeSeriesEntry<V>>>
entryRange(long startTimestamp, long endTimestamp)
Returns ordered entries of this time-series collection within timestamp range.reactor.core.publisher.Mono<Collection<TimeSeriesEntry<V>>>
entryRangeReversed(long startTimestamp, long endTimestamp)
Returns entries of this time-series collection in reverse order within timestamp range.reactor.core.publisher.Mono<V>
first()
Returns the head element ornull
if this time-series collection is empty.reactor.core.publisher.Mono<Collection<V>>
first(int count)
Returns the head elements of this time-series collection.reactor.core.publisher.Mono<Long>
firstTimestamp()
Returns timestamp of the head timestamp ornull
if this time-series collection is empty.reactor.core.publisher.Mono<V>
get(long timestamp)
Returns object by specifiedtimestamp
ornull
if it doesn't exist.reactor.core.publisher.Flux<V>
iterator()
Returns iterator over collection elementsreactor.core.publisher.Mono<V>
last()
Returns the tail element ornull
if this time-series collection is empty.reactor.core.publisher.Mono<Collection<V>>
last(int count)
Returns the tail elements of this time-series collection.reactor.core.publisher.Mono<Long>
lastTimestamp()
Returns timestamp of the tail element ornull
if this time-series collection is empty.reactor.core.publisher.Mono<V>
pollFirst()
Removes and returns the head element ornull
if this time-series collection is empty.reactor.core.publisher.Mono<Collection<V>>
pollFirst(int count)
Removes and returns the head elements ornull
if this time-series collection is empty.reactor.core.publisher.Mono<V>
pollLast()
Removes and returns the tail element ornull
if this time-series collection is empty.reactor.core.publisher.Mono<Collection<V>>
pollLast(int count)
Removes and returns the tail elements ornull
if this time-series collection is empty.reactor.core.publisher.Mono<Collection<V>>
range(long startTimestamp, long endTimestamp)
Returns ordered elements of this time-series collection within timestamp range.reactor.core.publisher.Mono<Collection<V>>
rangeReversed(long startTimestamp, long endTimestamp)
Returns elements of this time-series collection in reverse order within timestamp range.reactor.core.publisher.Mono<Boolean>
remove(long timestamp)
Removes object by specifiedtimestamp
.reactor.core.publisher.Mono<Integer>
removeRange(long startTimestamp, long endTimestamp)
Removes values within timestamp range.reactor.core.publisher.Mono<Integer>
size()
Returns size of this set.-
Methods inherited from interface org.redisson.api.RExpirableReactive
clearExpire, expire, expireAt, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RObjectReactive
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
-
-
-
Method Detail
-
iterator
reactor.core.publisher.Flux<V> iterator()
Returns iterator over collection elements- Returns:
- iterator
-
add
reactor.core.publisher.Mono<Void> add(long timestamp, V object)
Adds element to this time-series collection by specifiedtimestamp
.- Parameters:
timestamp
- - object timestampobject
- - object itself- Returns:
- void
-
addAll
reactor.core.publisher.Mono<Void> addAll(Map<Long,V> objects)
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- Returns:
- void
-
add
reactor.core.publisher.Mono<Void> add(long timestamp, V object, long timeToLive, TimeUnit timeUnit)
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- Returns:
- void
-
addAll
reactor.core.publisher.Mono<Void> addAll(Map<Long,V> objects, long timeToLive, TimeUnit timeUnit)
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- Returns:
- void
-
size
reactor.core.publisher.Mono<Integer> size()
Returns size of this set.- Returns:
- size
-
get
reactor.core.publisher.Mono<V> get(long timestamp)
Returns object by specifiedtimestamp
ornull
if it doesn't exist.- Parameters:
timestamp
- - object timestamp- Returns:
- object
-
remove
reactor.core.publisher.Mono<Boolean> remove(long timestamp)
Removes object by specifiedtimestamp
.- Parameters:
timestamp
- - object timestamp- Returns:
true
if an element was removed as a result of this call
-
pollFirst
reactor.core.publisher.Mono<Collection<V>> pollFirst(int count)
Removes and returns the head elements ornull
if this time-series collection is empty.- Parameters:
count
- - elements amount- Returns:
- the head element,
or
null
if this time-series collection is empty
-
pollLast
reactor.core.publisher.Mono<Collection<V>> pollLast(int count)
Removes and returns the tail elements ornull
if this time-series collection is empty.- Parameters:
count
- - elements amount- Returns:
- the tail element or
null
if this time-series collection is empty
-
pollFirst
reactor.core.publisher.Mono<V> pollFirst()
Removes and returns the head element ornull
if this time-series collection is empty.- Returns:
- the head element,
or
null
if this time-series collection is empty
-
pollLast
reactor.core.publisher.Mono<V> pollLast()
Removes and returns the tail element ornull
if this time-series collection is empty.- Returns:
- the tail element or
null
if this time-series collection is empty
-
last
reactor.core.publisher.Mono<V> last()
Returns the tail element ornull
if this time-series collection is empty.- Returns:
- the tail element or
null
if this time-series collection is empty
-
first
reactor.core.publisher.Mono<V> first()
Returns the head element ornull
if this time-series collection is empty.- Returns:
- the head element or
null
if this time-series collection is empty
-
firstTimestamp
reactor.core.publisher.Mono<Long> firstTimestamp()
Returns timestamp of the head timestamp ornull
if this time-series collection is empty.- Returns:
- timestamp or
null
if this time-series collection is empty
-
lastTimestamp
reactor.core.publisher.Mono<Long> lastTimestamp()
Returns timestamp of the tail element ornull
if this time-series collection is empty.- Returns:
- timestamp or
null
if this time-series collection is empty
-
last
reactor.core.publisher.Mono<Collection<V>> last(int count)
Returns the tail elements of this time-series collection.- Parameters:
count
- - elements amount- Returns:
- the tail elements
-
first
reactor.core.publisher.Mono<Collection<V>> first(int count)
Returns the head elements of this time-series collection.- Parameters:
count
- - elements amount- Returns:
- the head elements
-
removeRange
reactor.core.publisher.Mono<Integer> 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
reactor.core.publisher.Mono<Collection<V>> range(long startTimestamp, long endTimestamp)
Returns ordered elements of this time-series collection within timestamp range. Including boundary values.- Parameters:
startTimestamp
- - start timestampendTimestamp
- - end timestamp- Returns:
- elements collection
-
rangeReversed
reactor.core.publisher.Mono<Collection<V>> rangeReversed(long startTimestamp, long endTimestamp)
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
-
entryRange
reactor.core.publisher.Mono<Collection<TimeSeriesEntry<V>>> entryRange(long startTimestamp, long endTimestamp)
Returns ordered entries of this time-series collection within timestamp range. Including boundary values.- Parameters:
startTimestamp
- - start timestampendTimestamp
- - end timestamp- Returns:
- elements collection
-
entryRangeReversed
reactor.core.publisher.Mono<Collection<TimeSeriesEntry<V>>> entryRangeReversed(long startTimestamp, long endTimestamp)
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
-
-