public class RedisTimeSeries extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
protected static byte[] |
MINUS |
protected static byte[] |
PLUS |
Constructor and Description |
---|
RedisTimeSeries()
Create a new RedisTimeSeries client with default connection to local host
|
RedisTimeSeries(redis.clients.jedis.util.Pool<redis.clients.jedis.Jedis> pool) |
RedisTimeSeries(String host) |
RedisTimeSeries(String host,
int port)
Create a new RedisTimeSeries client
|
RedisTimeSeries(String host,
int port,
int timeout,
int poolSize)
Create a new RedisTimeSeries client
|
RedisTimeSeries(String host,
int port,
int timeout,
int poolSize,
String password)
Create a new RedisTimeSeries client
|
Modifier and Type | Method and Description |
---|---|
long |
add(String sourceKey,
double value)
TS.ADD key * value
|
long |
add(String sourceKey,
double value,
CreateParams createParams)
TS.ADD key timestamp value [RETENTION retentionTime] [UNCOMPRESSED] [CHUNK_SIZE size]
[ON_DUPLICATE policy] [LABELS label value..]
|
long |
add(String sourceKey,
double value,
long retentionTime)
TS.ADD key * value [RETENTION retentionTime]
|
long |
add(String sourceKey,
long timestamp,
double value)
TS.ADD key timestamp value
|
long |
add(String sourceKey,
long timestamp,
double value,
CreateParams addParams)
TS.ADD key timestamp value [RETENTION retentionTime] [UNCOMPRESSED] [CHUNK_SIZE size]
[ON_DUPLICATE policy] [LABELS label value..]
|
long |
add(String sourceKey,
long timestamp,
double value,
long retentionTime)
TS.ADD key timestamp value [RETENTION retentionTime]
|
long |
add(String sourceKey,
long timestamp,
double value,
long retentionTime,
boolean uncompressed,
long chunkSize,
DuplicatePolicy duplicatePolicy,
Map<String,String> labels)
TS.ADD key timestamp value [RETENTION retentionTime] UNCOMPRESSED [CHUNK_SIZE size]
[ON_DUPLICATE policy] [LABELS label value..]
|
long |
add(String sourceKey,
long timestamp,
double value,
long retentionTime,
boolean uncompressed,
Map<String,String> labels)
TS.ADD key timestamp value [RETENTION retentionTime] UNCOMPRESSED [LABELS field value..]
|
long |
add(String sourceKey,
long timestamp,
double value,
long retentionTime,
Map<String,String> labels)
TS.ADD key timestamp value [RETENTION retentionTime] [LABELS field value..]
|
long |
add(String sourceKey,
long timestamp,
double value,
Map<String,String> labels)
TS.ADD key timestamp value [RETENTION retentionTime] [LABELS field value..]
|
boolean |
alter(String key,
long retentionTime,
Map<String,String> labels)
TS.ALTER key [RETENTION retentionTime] [LABELS label value..]
|
boolean |
alter(String key,
Map<String,String> labels)
TS.ALTER key [LABELS label value..]
|
void |
close() |
boolean |
create(String key)
TS.CREATE key
|
boolean |
create(String key,
CreateParams createParams)
TS.CREATE key [RETENTION retentionTime] [UNCOMPRESSED] [CHUNK_SIZE size] [DUPLICATE_POLICY
policy] [LABELS label value..]
|
boolean |
create(String key,
long retentionTime)
TS.CREATE key [RETENTION retentionTime]
|
boolean |
create(String key,
long retentionTime,
boolean uncompressed,
long chunkSize,
DuplicatePolicy duplicatePolicy,
Map<String,String> labels)
TS.CREATE key [RETENTION retentionTime] [UNCOMPRESSED] [CHUNK_SIZE size] [DUPLICATE_POLICY
policy] [LABELS label value..]
|
boolean |
create(String key,
long retentionTime,
boolean uncompressed,
Map<String,String> labels)
TS.CREATE key [RETENTION retentionTime] [UNCOMPRESSED] [LABELS field value..]
|
boolean |
create(String key,
long retentionTime,
Map<String,String> labels)
TS.CREATE key [RETENTION retentionTime] [LABELS field value..]
|
boolean |
create(String key,
Map<String,String> labels)
TS.CREATE key [LABELS field value..]
|
boolean |
createRule(String sourceKey,
Aggregation aggregation,
long bucketSize,
String destKey)
TS.CREATERULE sourceKey destKey AGGREGATION aggType retentionTime
|
long |
decrBy(String key,
int value)
TS.DECRBY key value
|
long |
decrBy(String key,
int value,
long timestamp)
TS.DECRBY key value [TIMESTAMP timestamp]
|
long |
del(String key,
long from,
long to)
TS.DEL key fromTimestamp toTimestamp
|
boolean |
deleteRule(String sourceKey,
String destKey)
TS.DELETERULE SOURCE_KEY DEST_KEY
|
Value |
get(String key)
TS.GET key
|
long |
incrBy(String key,
int value)
TS.INCRBY key value
|
long |
incrBy(String key,
int value,
long timestamp)
TS.INCRBY key value [TIMESTAMP timestamp]
|
Info |
info(String key)
TS.INFO key
|
List<Object> |
madd(Measurement... measurements)
TS.MADD key timestamp value [key timestamp value ...]
|
Range[] |
mget(boolean withLabels,
String... filters)
TS.MGET [WITHLABELS] FILTER filter...
|
Range[] |
mrange(long from,
long to,
Aggregation aggregation,
long timeBucket,
boolean withLabels,
int count,
String... filters)
TS.MRANGE fromTimestamp toTimestamp [COUNT count] [AGGREGATION aggregationType timeBucket]
FILTER filter.
|
Range[] |
mrange(long from,
long to,
Aggregation aggregation,
long timeBucket,
boolean withLabels,
String... filters)
TS.MRANGE fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket] FILTER filter.
|
Range[] |
mrange(long from,
long to,
Aggregation aggregation,
long timeBucket,
String... filters)
TS.MRANGE fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket] FILTER filter.
|
Range[] |
mrange(long from,
long to,
int count,
String... filters)
TS.MRANGE fromTimestamp toTimestamp [COUNT count] FILTER filter.
|
Range[] |
mrange(Long from,
Long to,
MultiRangeParams multiRangeParams,
String... filters)
TS.MRANGE fromTimestamp toTimestamp [COUNT count] [AGGREGATION aggregationType timeBucket]
[WITHLABELS] FILTER filter...
|
Range[] |
mrange(long from,
long to,
String... filters)
TS.MRANGE fromTimestamp toTimestamp FILTER filter.
|
Range[] |
mrevrange(long from,
long to,
Aggregation aggregation,
long timeBucket,
boolean withLabels,
int count,
String... filters)
TS.MREVRANGE fromTimestamp toTimestamp [COUNT count] [AGGREGATION aggregationType timeBucket]
[WITHLABELS] FILTER filter..
|
Range[] |
mrevrange(long from,
long to,
Aggregation aggregation,
long timeBucket,
boolean withLabels,
String... filters)
TS.MREVRANGE fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket] FILTER filter.
|
Range[] |
mrevrange(long from,
long to,
Aggregation aggregation,
long timeBucket,
String... filters)
TS.MREVRANGE fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket] FILTER filter.
|
Range[] |
mrevrange(long from,
long to,
int count,
String... filters)
TS.MREVRANGE fromTimestamp toTimestamp [COUNT count] FILTER filter.
|
Range[] |
mrevrange(Long from,
Long to,
MultiRangeParams multiRangeParams,
String... filters)
TS.MREVRANGE fromTimestamp toTimestamp [COUNT count] [AGGREGATION aggregationType timeBucket]
[WITHLABELS] FILTER filter...
|
Range[] |
mrevrange(long from,
long to,
String... filters)
TS.MREVRANGE fromTimestamp toTimestamp FILTER filter.
|
String[] |
queryIndex(String... filters)
TS.QUERYINDEX filter...
|
Value[] |
range(String key,
long from,
long to)
TS.RANGE key fromTimestamp toTimestamp
|
Value[] |
range(String key,
long from,
long to,
Aggregation aggregation,
long timeBucket)
TS.RANGE key fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket]
|
Value[] |
range(String key,
long from,
long to,
Aggregation aggregation,
long timeBucket,
int count)
TS.RANGE key fromTimestamp toTimestamp [COUNT count] [AGGREGATION aggregationType timeBucket]
|
Value[] |
range(String key,
long from,
long to,
int count)
TS.RANGE key fromTimestamp toTimestamp [COUNT count]
|
Value[] |
range(String key,
Long from,
Long to,
RangeParams rangeParams)
TS.RANGE key fromTimestamp toTimestamp [COUNT count] [AGGREGATION aggregationType timeBucket]
|
Value[] |
revrange(String key,
long from,
long to)
TS.REVRANGE key fromTimestamp toTimestamp
|
Value[] |
revrange(String key,
long from,
long to,
Aggregation aggregation,
long timeBucket)
TS.REVRANGE key fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket]
|
Value[] |
revrange(String key,
long from,
long to,
Aggregation aggregation,
long timeBucket,
int count)
TS.REVRANGE key fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket] [COUNT
count]
|
Value[] |
revrange(String key,
long from,
long to,
int count)
TS.REVRANGE key fromTimestamp toTimestamp [COUNT count]
|
Value[] |
revrange(String key,
Long from,
Long to,
RangeParams rangeParams)
TS.REVRANGE key fromTimestamp toTimestamp [COUNT count] [AGGREGATION aggregationType
timeBucket]
|
public RedisTimeSeries()
public RedisTimeSeries(String host)
public RedisTimeSeries(String host, int port)
host
- the redis hostport
- the redis potpublic RedisTimeSeries(String host, int port, int timeout, int poolSize)
host
- the redis hostport
- the redis potpublic RedisTimeSeries(String host, int port, int timeout, int poolSize, String password)
host
- the redis hostport
- the redis potpassword
- the password for authentication in a password protected Redis serverpublic RedisTimeSeries(redis.clients.jedis.util.Pool<redis.clients.jedis.Jedis> pool)
public boolean create(String key)
key
- public boolean create(String key, long retentionTime)
key
- retentionTime
- public boolean create(String key, Map<String,String> labels)
key
- labels
- public boolean create(String key, long retentionTime, Map<String,String> labels)
key
- retentionTime
- labels
- public boolean create(String key, long retentionTime, boolean uncompressed, Map<String,String> labels)
key
- retentionTime
- uncompressed
- labels
- public boolean create(String key, long retentionTime, boolean uncompressed, long chunkSize, DuplicatePolicy duplicatePolicy, Map<String,String> labels)
key
- retentionTime
- uncompressed
- labels
- chunkSize
- duplicatePolicy
- public boolean create(String key, CreateParams createParams)
key
- createParams
- public long del(String key, long from, long to)
key
- from
- timestamp fromto
- timestamp topublic boolean alter(String key, Map<String,String> labels)
key
- labels
- public boolean alter(String key, long retentionTime, Map<String,String> labels)
key
- retentionTime
- labels
- public boolean createRule(String sourceKey, Aggregation aggregation, long bucketSize, String destKey)
sourceKey
- aggregation
- bucketSize
- destKey
- public boolean deleteRule(String sourceKey, String destKey)
sourceKey
- destKey
- public long add(String sourceKey, double value)
sourceKey
- value
- public long add(String sourceKey, long timestamp, double value)
sourceKey
- timestamp
- value
- public long add(String sourceKey, long timestamp, double value, long retentionTime)
sourceKey
- timestamp
- value
- retentionTime
- public long add(String sourceKey, double value, long retentionTime)
sourceKey
- value
- retentionTime
- public long add(String sourceKey, long timestamp, double value, Map<String,String> labels)
sourceKey
- timestamp
- value
- labels
- public long add(String sourceKey, long timestamp, double value, long retentionTime, Map<String,String> labels)
sourceKey
- timestamp
- value
- retentionTime
- labels
- public long add(String sourceKey, long timestamp, double value, long retentionTime, boolean uncompressed, Map<String,String> labels)
sourceKey
- timestamp
- value
- retentionTime
- uncompressed
- labels
- public long add(String sourceKey, long timestamp, double value, long retentionTime, boolean uncompressed, long chunkSize, DuplicatePolicy duplicatePolicy, Map<String,String> labels)
sourceKey
- timestamp
- value
- retentionTime
- chunkSize
- duplicatePolicy
- uncompressed
- labels
- public long add(String sourceKey, double value, CreateParams createParams)
sourceKey
- value
- createParams
- public long add(String sourceKey, long timestamp, double value, CreateParams addParams)
sourceKey
- timestamp
- value
- addParams
- public List<Object> madd(Measurement... measurements)
measurements
- public Value[] range(String key, long from, long to)
key
- from
- to
- public Value[] range(String key, long from, long to, int count)
key
- from
- to
- public Value[] range(String key, long from, long to, Aggregation aggregation, long timeBucket)
key
- from
- to
- public Value[] range(String key, long from, long to, Aggregation aggregation, long timeBucket, int count)
key
- from
- to
- count
- public Value[] range(String key, Long from, Long to, RangeParams rangeParams)
key
- from
- timestamp. null
represents "-"
to
- timestamp. null
represents "+"
rangeParams
- public Value[] revrange(String key, long from, long to)
key
- from
- to
- public Value[] revrange(String key, long from, long to, int count)
key
- from
- to
- count
- public Value[] revrange(String key, long from, long to, Aggregation aggregation, long timeBucket)
key
- from
- to
- aggregation
- timeBucket
- public Value[] revrange(String key, long from, long to, Aggregation aggregation, long timeBucket, int count)
key
- from
- to
- aggregation
- timeBucket
- count
- public Value[] revrange(String key, Long from, Long to, RangeParams rangeParams)
key
- from
- timestamp. null
represents "-"
to
- timestamp. null
represents "+"
rangeParams
- public Range[] mrange(long from, long to, String... filters)
mrange(from, to, null, 0, false, null, filters)
from
- to
- filters
- public Range[] mrange(long from, long to, int count, String... filters)
mrange(from, to, null, 0, false, null, filters)
from
- to
- count
- filters
- public Range[] mrange(long from, long to, Aggregation aggregation, long timeBucket, String... filters)
mrange(from, to, aggregation, retentionTime, false, null, filters)
from
- to
- aggregation
- timeBucket
- filters
- public Range[] mrange(long from, long to, Aggregation aggregation, long timeBucket, boolean withLabels, String... filters)
mrange(from, to, aggregation, retentionTime, false, null, filters)
from
- to
- aggregation
- timeBucket
- filters
- public Range[] mrange(long from, long to, Aggregation aggregation, long timeBucket, boolean withLabels, int count, String... filters)
mrange(from, to, aggregation, retentionTime, false, null, filters)
from
- to
- aggregation
- timeBucket
- filters
- count
- public Range[] mrange(Long from, Long to, MultiRangeParams multiRangeParams, String... filters)
from
- timestamp. null
represents "-"
to
- timestamp. null
represents "+"
multiRangeParams
- filters
- public Range[] mrevrange(long from, long to, String... filters)
mrevrange(from, to, null, 0, false, null, filters)
from
- to
- filters
- public Range[] mrevrange(long from, long to, int count, String... filters)
mrevrange(from, to, null, 0, false, null, filters)
from
- to
- count
- filters
- public Range[] mrevrange(long from, long to, Aggregation aggregation, long timeBucket, String... filters)
mrevrange(from, to, aggregation, retentionTime, false, null, filters)
from
- to
- aggregation
- timeBucket
- filters
- public Range[] mrevrange(long from, long to, Aggregation aggregation, long timeBucket, boolean withLabels, String... filters)
mrevrange(from, to, aggregation, retentionTime, false, null, filters)
from
- to
- aggregation
- timeBucket
- filters
- public Range[] mrevrange(long from, long to, Aggregation aggregation, long timeBucket, boolean withLabels, int count, String... filters)
from
- to
- aggregation
- timeBucket
- withLabels
- true
if the labels should be returned for each rangecount
- filters
- public Range[] mrevrange(Long from, Long to, MultiRangeParams multiRangeParams, String... filters)
from
- timestamp. null
represents "-"
to
- timestamp. null
represents "+"
multiRangeParams
- filters
- public Range[] mget(boolean withLabels, String... filters)
withLabels
- filters
- public long incrBy(String key, int value)
key
- value
- public long incrBy(String key, int value, long timestamp)
key
- value
- timestamp
- public long decrBy(String key, int value)
key
- value
- public long decrBy(String key, int value, long timestamp)
key
- value
- timestamp
- public void close()
close
in interface AutoCloseable
Copyright © 2021. All rights reserved.