Class ReactiveTimeSeriesCommandsImpl<K>
- java.lang.Object
-
- io.quarkus.redis.runtime.datasource.AbstractRedisCommands
-
- io.quarkus.redis.runtime.datasource.AbstractTimeSeriesCommands<K>
-
- io.quarkus.redis.runtime.datasource.ReactiveTimeSeriesCommandsImpl<K>
-
- All Implemented Interfaces:
ReactiveRedisCommands,ReactiveTimeSeriesCommands<K>
public class ReactiveTimeSeriesCommandsImpl<K> extends AbstractTimeSeriesCommands<K> implements ReactiveTimeSeriesCommands<K>, ReactiveRedisCommands
-
-
Field Summary
Fields Modifier and Type Field Description protected Class<K>keyType-
Fields inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommands
marshaller, redis
-
-
Constructor Summary
Constructors Constructor Description ReactiveTimeSeriesCommandsImpl(ReactiveRedisDataSourceImpl redis, Class<K> k)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) Map<String,SampleGroup>decodeGroup(io.vertx.mutiny.redis.client.Response response)(package private) SampledecodeSample(io.vertx.mutiny.redis.client.Response response)ReactiveRedisDataSourcegetDataSource()io.smallrye.mutiny.Uni<Void>tsAdd(K key, double value)Execute the command TS.ADD.io.smallrye.mutiny.Uni<Void>tsAdd(K key, double value, AddArgs args)Execute the command TS.ADD.io.smallrye.mutiny.Uni<Void>tsAdd(K key, long timestamp, double value)Execute the command TS.ADD.io.smallrye.mutiny.Uni<Void>tsAdd(K key, long timestamp, double value, AddArgs args)Execute the command TS.ADD.io.smallrye.mutiny.Uni<Void>tsAlter(K key, AlterArgs args)Execute the command TS.ALTER.io.smallrye.mutiny.Uni<Void>tsCreate(K key)Execute the command TS.CREATE.io.smallrye.mutiny.Uni<Void>tsCreate(K key, CreateArgs args)Execute the command TS.CREATE.io.smallrye.mutiny.Uni<Void>tsCreateRule(K key, K destKey, Aggregation aggregation, Duration bucketDuration)Execute the command TS.CREATERULE.io.smallrye.mutiny.Uni<Void>tsCreateRule(K key, K destKey, Aggregation aggregation, Duration bucketDuration, long alignTimestamp)Execute the command TS.CREATERULE.io.smallrye.mutiny.Uni<Void>tsDecrBy(K key, double value)Execute the command TS.DECRBY.io.smallrye.mutiny.Uni<Void>tsDecrBy(K key, double value, IncrementArgs args)Execute the command TS.DECRBY.io.smallrye.mutiny.Uni<Void>tsDel(K key, long fromTimestamp, long toTimestamp)Execute the command TS.DEL.io.smallrye.mutiny.Uni<Void>tsDeleteRule(K key, K destKey)Execute the command TS.DELETERULE.io.smallrye.mutiny.Uni<Sample>tsGet(K key)Execute the command TS.GET.io.smallrye.mutiny.Uni<Sample>tsGet(K key, boolean latest)Execute the command TS.GET.io.smallrye.mutiny.Uni<Void>tsIncrBy(K key, double value)Execute the command TS.INCRBY.io.smallrye.mutiny.Uni<Void>tsIncrBy(K key, double value, IncrementArgs args)Execute the command TS.INCRBY.io.smallrye.mutiny.Uni<Void>tsMAdd(SeriesSample<K>... samples)Execute the command TS.MADD.io.smallrye.mutiny.Uni<Map<String,SampleGroup>>tsMGet(Filter... filters)Execute the command TS.MGET.io.smallrye.mutiny.Uni<Map<String,SampleGroup>>tsMGet(MGetArgs args, Filter... filters)Execute the command TS.MGET.io.smallrye.mutiny.Uni<Map<String,SampleGroup>>tsMRange(TimeSeriesRange range, Filter... filters)Execute the command TS.MRANGE.io.smallrye.mutiny.Uni<Map<String,SampleGroup>>tsMRange(TimeSeriesRange range, MRangeArgs args, Filter... filters)Execute the command TS.MRANGE.io.smallrye.mutiny.Uni<Map<String,SampleGroup>>tsMRevRange(TimeSeriesRange range, Filter... filters)Execute the command TS.MREVRANGE.io.smallrye.mutiny.Uni<Map<String,SampleGroup>>tsMRevRange(TimeSeriesRange range, MRangeArgs args, Filter... filters)Execute the command TS.MREVRANGE.io.smallrye.mutiny.Uni<List<K>>tsQueryIndex(Filter... filters)Execute the command TS.QUERYINDEX.io.smallrye.mutiny.Uni<List<Sample>>tsRange(K key, TimeSeriesRange range)Execute the command TS.RANGE.io.smallrye.mutiny.Uni<List<Sample>>tsRange(K key, TimeSeriesRange range, RangeArgs args)Execute the command TS.RANGE.io.smallrye.mutiny.Uni<List<Sample>>tsRevRange(K key, TimeSeriesRange range)Execute the command TS.REVRANGE.io.smallrye.mutiny.Uni<List<Sample>>tsRevRange(K key, TimeSeriesRange range, RangeArgs args)Execute the command TS.REVRANGE.-
Methods inherited from class io.quarkus.redis.runtime.datasource.AbstractTimeSeriesCommands
_tsAdd, _tsAdd, _tsAdd, _tsAdd, _tsAlter, _tsCreate, _tsCreate, _tsCreateRule, _tsCreateRule, _tsDecrBy, _tsDecrBy, _tsDel, _tsDeleteRule, _tsGet, _tsGet, _tsIncrBy, _tsIncrBy, _tsMAdd, _tsMGet, _tsMGet, _tsMRange, _tsMRange, _tsMRevRange, _tsMRevRange, _tsQueryIndex, _tsRange, _tsRange, _tsRevRange, _tsRevRange
-
Methods inherited from class io.quarkus.redis.runtime.datasource.AbstractRedisCommands
execute
-
-
-
-
Constructor Detail
-
ReactiveTimeSeriesCommandsImpl
public ReactiveTimeSeriesCommandsImpl(ReactiveRedisDataSourceImpl redis, Class<K> k)
-
-
Method Detail
-
getDataSource
public ReactiveRedisDataSource getDataSource()
- Specified by:
getDataSourcein interfaceReactiveRedisCommands- Returns:
- the data source.
-
tsCreate
public io.smallrye.mutiny.Uni<Void> tsCreate(K key, CreateArgs args)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.CREATE. Summary: Create a new time series Group: time series- Specified by:
tsCreatein interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series must not benullargs- the creation arguments.- Returns:
- A uni emitting
nullwhen the operation completes
-
tsCreate
public io.smallrye.mutiny.Uni<Void> tsCreate(K key)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.CREATE. Summary: Create a new time series Group: time series- Specified by:
tsCreatein interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series must not benull- Returns:
- A uni emitting
nullwhen the operation completes
-
tsAdd
public io.smallrye.mutiny.Uni<Void> tsAdd(K key, long timestamp, double value, AddArgs args)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.ADD. Summary: Append a sample to a time series Group: time series- Specified by:
tsAddin interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series must not benulltimestamp- the (long) UNIX sample timestamp in milliseconds or-1to set the timestamp according to the server clock.value- the numeric data value of the sample.args- the creation arguments.- Returns:
- A uni emitting
nullwhen the operation completes
-
tsAdd
public io.smallrye.mutiny.Uni<Void> tsAdd(K key, double value, AddArgs args)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.ADD. Summary: Append a sample to a time series Group: time seriesUnlike
ReactiveTimeSeriesCommands.tsAdd(Object, long, double, AddArgs), set the timestamp according to the server clock.- Specified by:
tsAddin interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series must not benullvalue- the numeric data value of the sample.args- the creation arguments.- Returns:
- A uni emitting
nullwhen the operation completes
-
tsAdd
public io.smallrye.mutiny.Uni<Void> tsAdd(K key, long timestamp, double value)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.ADD. Summary: Append a sample to a time series Group: time series- Specified by:
tsAddin interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series, must not benulltimestamp- the (long) UNIX sample timestamp in millisecondsvalue- the numeric data value of the sample- Returns:
- A uni emitting
nullwhen the operation completes
-
tsAdd
public io.smallrye.mutiny.Uni<Void> tsAdd(K key, double value)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.ADD. Summary: Append a sample to a time series Group: time seriesUnlike
ReactiveTimeSeriesCommands.tsAdd(Object, long, double), set the timestamp according to the server clock.- Specified by:
tsAddin interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series. must not benullvalue- the numeric data value of the sample, must not benull- Returns:
- A uni emitting
nullwhen the operation completes
-
tsAlter
public io.smallrye.mutiny.Uni<Void> tsAlter(K key, AlterArgs args)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.ALTER. Summary: Update the retention, chunk size, duplicate policy, and labels of an existing time series Group: time series- Specified by:
tsAlterin interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series, must not benullargs- the alter parameters, must not benull- Returns:
- A uni emitting
nullwhen the operation completes
-
tsCreateRule
public io.smallrye.mutiny.Uni<Void> tsCreateRule(K key, K destKey, Aggregation aggregation, Duration bucketDuration)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.CREATERULE. Summary: Create a compaction rule Group: time series- Specified by:
tsCreateRulein interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series, must not benulldestKey- the key name for destination (compacted) time series. It must be created before TS.CREATERULE is called. Must not benull.aggregation- the aggregation function, must not benullbucketDuration- the duration of each bucket, must not benull- Returns:
- A uni emitting
nullwhen the operation completes
-
tsCreateRule
public io.smallrye.mutiny.Uni<Void> tsCreateRule(K key, K destKey, Aggregation aggregation, Duration bucketDuration, long alignTimestamp)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.CREATERULE. Summary: Create a compaction rule Group: time series- Specified by:
tsCreateRulein interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series, must not benulldestKey- the key name for destination (compacted) time series. It must be created before TS.CREATERULE is called. Must not benull.aggregation- the aggregation function, must not benullbucketDuration- the duration of each bucket, must not benullalignTimestamp- when set, ensures that there is a bucket that starts exactly at alignTimestamp and aligns all other buckets accordingly. It is expressed in milliseconds. The default value is 0 aligned with the epoch. For example, if bucketDuration is 24 hours (24 * 3600 * 1000), setting alignTimestamp to 6 hours after the epoch (6 * 3600 * 1000) ensures that each bucket’s timeframe is [06:00 .. 06:00).- Returns:
- A uni emitting
nullwhen the operation completes
-
tsDecrBy
public io.smallrye.mutiny.Uni<Void> tsDecrBy(K key, double value)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.DECRBY. Summary: Decrease the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given decrement Group: time series- Specified by:
tsDecrByin interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series. must not benullvalue- the numeric data value of the sample, must not benull- Returns:
- A uni emitting
nullwhen the operation completes
-
tsDecrBy
public io.smallrye.mutiny.Uni<Void> tsDecrBy(K key, double value, IncrementArgs args)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.DECRBY. Summary: Decrease the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given decrement Group: time series- Specified by:
tsDecrByin interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series. must not benullvalue- the numeric data value of the sample, must not benullargs- the extra command parameters- Returns:
- A uni emitting
nullwhen the operation completes
-
tsDel
public io.smallrye.mutiny.Uni<Void> tsDel(K key, long fromTimestamp, long toTimestamp)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.DEL. Summary: Delete all samples between two timestamps for a given time series Group: time seriesThe given timestamp interval is closed (inclusive), meaning that samples whose timestamp equals the fromTimestamp or toTimestamp are also deleted.
- Specified by:
tsDelin interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series. must not benullfromTimestamp- the start timestamp for the range deletion.toTimestamp- the end timestamp for the range deletion.- Returns:
- A uni emitting
nullwhen the operation completes
-
tsDeleteRule
public io.smallrye.mutiny.Uni<Void> tsDeleteRule(K key, K destKey)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.DELETERULE. Summary: Delete a compaction rule Group: time series- Specified by:
tsDeleteRulein interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series. must not benulldestKey- the key name for destination (compacted) time series. Note that the command does not delete the compacted series. Must not benull- Returns:
- A uni emitting
nullwhen the operation completes
-
tsGet
public io.smallrye.mutiny.Uni<Sample> tsGet(K key)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.GET. Summary: Get the last sample Group: time series- Specified by:
tsGetin interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series. must not benull- Returns:
- A uni emitting a
Sample, i.e. a couple containing the timestamp and the value.
-
decodeSample
Sample decodeSample(io.vertx.mutiny.redis.client.Response response)
-
tsGet
public io.smallrye.mutiny.Uni<Sample> tsGet(K key, boolean latest)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.GET. Summary: Get the last sample Group: time series- Specified by:
tsGetin interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series. must not benulllatest- used when a time series is a compaction. With LATEST set totrue, TS.MRANGE also reports the compacted value of the latest possibly partial bucket, given that this bucket's start time falls within [fromTimestamp, toTimestamp]. Without LATEST, TS.MRANGE does not report the latest possibly partial bucket. When a time series is not a compaction, LATEST is ignored.- Returns:
- A uni emitting a
Sample, i.e. a couple containing the timestamp and the value.
-
tsIncrBy
public io.smallrye.mutiny.Uni<Void> tsIncrBy(K key, double value)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.INCRBY. Summary: Increase the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given increment. Group: time series- Specified by:
tsIncrByin interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series. must not benullvalue- the numeric data value of the sample, must not benull- Returns:
- A uni emitting
nullwhen the operation completes
-
tsIncrBy
public io.smallrye.mutiny.Uni<Void> tsIncrBy(K key, double value, IncrementArgs args)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.INCRBY. Summary: Increase the value of the sample with the maximum existing timestamp, or create a new sample with a value equal to the value of the sample with the maximum existing timestamp with a given increment. Group: time series- Specified by:
tsIncrByin interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series. must not benullvalue- the numeric data value of the sample, must not benullargs- the extra command parameters- Returns:
- A uni emitting
nullwhen the operation completes
-
tsMAdd
public io.smallrye.mutiny.Uni<Void> tsMAdd(SeriesSample<K>... samples)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.MADD. Summary: Append new samples to one or more time series Group: time series- Specified by:
tsMAddin interfaceReactiveTimeSeriesCommands<K>- Parameters:
samples- the set of samples to add to the time series.- Returns:
- A uni emitting
nullwhen the operation completes
-
tsMGet
public io.smallrye.mutiny.Uni<Map<String,SampleGroup>> tsMGet(MGetArgs args, Filter... filters)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.MGET. Summary: Get the last samples matching a specific filter Group: time series- Specified by:
tsMGetin interfaceReactiveTimeSeriesCommands<K>- Parameters:
args- the extra command parameter, must not benullfilters- the filters. Instanced are created using the static methods fromFilter. Must not benull, or contain anullvalue.- Returns:
- A uni emitting a Map of
String -> SampleGroup, containing the matching sample grouped by key. The key is the string representation of the time series key.
-
tsMGet
public io.smallrye.mutiny.Uni<Map<String,SampleGroup>> tsMGet(Filter... filters)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.MGET. Summary: Get the last samples matching a specific filter Group: time series- Specified by:
tsMGetin interfaceReactiveTimeSeriesCommands<K>- Parameters:
filters- the filters. Instanced are created using the static methods fromFilter. Must not benull, or contain anullvalue.- Returns:
- A uni emitting a Map of
String -> SampleGroup, containing the matching sample grouped by key. The key is the string representation of the time series key.
-
decodeGroup
Map<String,SampleGroup> decodeGroup(io.vertx.mutiny.redis.client.Response response)
-
tsMRange
public io.smallrye.mutiny.Uni<Map<String,SampleGroup>> tsMRange(TimeSeriesRange range, Filter... filters)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.MRANGE. Summary: Query a range across multiple time series by filters in forward direction Group: time series- Specified by:
tsMRangein interfaceReactiveTimeSeriesCommands<K>- Parameters:
range- the range, must not benullfilters- the filters. Instanced are created using the static methods fromFilter. Must not benull, or contain anullvalue.- Returns:
- A uni emitting a Map of
String -> SampleGroup, containing the matching sample grouped by key. The key is the string representation of the time series key.
-
tsMRange
public io.smallrye.mutiny.Uni<Map<String,SampleGroup>> tsMRange(TimeSeriesRange range, MRangeArgs args, Filter... filters)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.MRANGE. Summary: Query a range across multiple time series by filters in forward direction Group: time series- Specified by:
tsMRangein interfaceReactiveTimeSeriesCommands<K>- Parameters:
range- the range, must not benullargs- the extra command parametersfilters- the filters. Instanced are created using the static methods fromFilter. Must not benull, or contain anullvalue.- Returns:
- A uni emitting a Map of
String -> SampleGroup, containing the matching sample grouped by key. The key is the string representation of the time series key.
-
tsMRevRange
public io.smallrye.mutiny.Uni<Map<String,SampleGroup>> tsMRevRange(TimeSeriesRange range, Filter... filters)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.MREVRANGE. Summary: Query a range across multiple time series by filters in reverse direction Group: time series- Specified by:
tsMRevRangein interfaceReactiveTimeSeriesCommands<K>- Parameters:
range- the range, must not benullfilters- the filters. Instanced are created using the static methods fromFilter. Must not benull, or contain anullvalue.- Returns:
- A uni emitting a Map of
String -> SampleGroup, containing the matching sample grouped by key. The key is the string representation of the time series key.
-
tsMRevRange
public io.smallrye.mutiny.Uni<Map<String,SampleGroup>> tsMRevRange(TimeSeriesRange range, MRangeArgs args, Filter... filters)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.MREVRANGE. Summary: Query a range across multiple time series by filters in reverse direction Group: time series- Specified by:
tsMRevRangein interfaceReactiveTimeSeriesCommands<K>- Parameters:
range- the range, must not benullargs- the extra command parametersfilters- the filters. Instanced are created using the static methods fromFilter. Must not benull, or contain anullvalue.- Returns:
- A uni emitting a Map of
String -> SampleGroup, containing the matching sample grouped by key. The key is the string representation of the time series key.
-
tsQueryIndex
public io.smallrye.mutiny.Uni<List<K>> tsQueryIndex(Filter... filters)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.QUERYINDEX. Summary: Get all time series keys matching a filter list Group: time series- Specified by:
tsQueryIndexin interfaceReactiveTimeSeriesCommands<K>- Parameters:
filters- the filter, created from theFilterclass. Must not benull, must not containnull- Returns:
- A uni emitting the list of keys containing time series matching the filters
-
tsRange
public io.smallrye.mutiny.Uni<List<Sample>> tsRange(K key, TimeSeriesRange range)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.RANGE. Summary: Query a range in forward direction Group: time series- Specified by:
tsRangein interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series, must not benullrange- the range, must not benull- Returns:
- A uni emitting the list of matching sample
-
tsRange
public io.smallrye.mutiny.Uni<List<Sample>> tsRange(K key, TimeSeriesRange range, RangeArgs args)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.RANGE. Summary: Query a range in forward direction Group: time series- Specified by:
tsRangein interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series, must not benullrange- the range, must not benullargs- the extra command parameters- Returns:
- A uni emitting the list of matching sample
-
tsRevRange
public io.smallrye.mutiny.Uni<List<Sample>> tsRevRange(K key, TimeSeriesRange range)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.REVRANGE. Summary: Query a range in reverse direction Group: time series- Specified by:
tsRevRangein interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series, must not benullrange- the range, must not benull- Returns:
- A uni emitting the list of matching sample
-
tsRevRange
public io.smallrye.mutiny.Uni<List<Sample>> tsRevRange(K key, TimeSeriesRange range, RangeArgs args)
Description copied from interface:ReactiveTimeSeriesCommandsExecute the command TS.REVRANGE. Summary: Query a range in reverse direction Group: time series- Specified by:
tsRevRangein interfaceReactiveTimeSeriesCommands<K>- Parameters:
key- the key name for the time series, must not benullrange- the range, must not benullargs- the extra command parameters- Returns:
- A uni emitting the list of matching sample
-
-