Class CreateArgs
- java.lang.Object
-
- io.quarkus.redis.datasource.timeseries.CreateArgs
-
- All Implemented Interfaces:
RedisCommandExtraArguments
public class CreateArgs extends Object implements RedisCommandExtraArguments
Represents the extra arguments of thets.create
command.
-
-
Constructor Summary
Constructors Constructor Description CreateArgs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateArgs
chunkSize(int size)
Sets the initial allocation size, in bytes, for the data part of each new chunk.CreateArgs
compressed()
Set the series samples encoding format toCOMPRESSED
, applies compression to the series samples.CreateArgs
duplicatePolicy(DuplicatePolicy policy)
Set the policy for handling insertion (TS.ADD and TS.MADD) of multiple samples with identical timestamps.CreateArgs
forever()
Set the retention duration so the samples never expire.CreateArgs
label(String label, Object value)
Set a label-value pairs that represent metadata labels of the key and serve as a secondary index.CreateArgs
setRetention(Duration retention)
Set the maximum age for samples compared to the highest reported timestamp, in milliseconds.List<Object>
toArgs()
CreateArgs
uncompressed()
Set the series samples encoding format toUNCOMPRESSED
, applies compression to the series samples.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.redis.datasource.RedisCommandExtraArguments
toArgs
-
-
-
-
Method Detail
-
setRetention
public CreateArgs setRetention(Duration retention)
Set the maximum age for samples compared to the highest reported timestamp, in milliseconds. Samples are expired based solely on the difference between their timestamp and the timestamps passed to subsequent TS.ADD, TS.MADD, TS.INCRBY, and TS.DECRBY calls.When set to 0, samples never expire. When not specified, the option is set to the global RETENTION_POLICY configuration of the database, which by default is 0.
- Parameters:
retention
- the retention, must not benull
- Returns:
- the current
CreateArgs
-
forever
public CreateArgs forever()
Set the retention duration so the samples never expire.- Returns:
- the current
CreateArgs
- See Also:
setRetention(Duration)
-
compressed
public CreateArgs compressed()
Set the series samples encoding format toCOMPRESSED
, applies compression to the series samples.COMPRESSED
is almost always the right choice. Compression not only saves memory but usually improves performance due to a lower number of memory accesses. It can result in about 90% memory reduction. The exception are highly irregular timestamps or values, which occur rarely.When not specified, the option is set to COMPRESSED.
- Returns:
- the current
CreateArgs
-
uncompressed
public CreateArgs uncompressed()
Set the series samples encoding format toUNCOMPRESSED
, applies compression to the series samples.COMPRESSED
is almost always the right choice. Compression not only saves memory but usually improves performance due to a lower number of memory accesses. It can result in about 90% memory reduction. The exception are highly irregular timestamps or values, which occur rarely.When not specified, the option is set to COMPRESSED.
- Returns:
- the current
CreateArgs
-
chunkSize
public CreateArgs chunkSize(int size)
Sets the initial allocation size, in bytes, for the data part of each new chunk. Actual chunks may consume more memory. Changing chunkSize (using TS.ALTER) does not affect existing chunks.Must be a multiple of 8 in the range [48 .. 1048576]. When not specified, it is set to 4096 bytes (a single memory page).
- Parameters:
size
- the chunk size, between 48 and 1048576- Returns:
- the current
CreateArgs
-
duplicatePolicy
public CreateArgs duplicatePolicy(DuplicatePolicy policy)
Set the policy for handling insertion (TS.ADD and TS.MADD) of multiple samples with identical timestamps.When not specified: set to the global DUPLICATE_POLICY configuration of the database (which, by default, is BLOCK).
- Parameters:
policy
- the policy, must not benull
- Returns:
- the current
CreateArgs
-
label
public CreateArgs label(String label, Object value)
Set a label-value pairs that represent metadata labels of the key and serve as a secondary index.The TS.MGET, TS.MRANGE, and TS.MREVRANGE commands operate on multiple time series based on their labels. The TS.QUERYINDEX command returns all time series keys matching a given filter based on their labels.
- Parameters:
label
- the label, must not benull
value
- the value, must not benull
- Returns:
- the current
CreateArgs
-
toArgs
public List<Object> toArgs()
- Specified by:
toArgs
in interfaceRedisCommandExtraArguments
- Returns:
- the list of arguments.
-
-