Package com.redislabs.redistimeseries
Class RedisTimeSeries
- java.lang.Object
-
- com.redislabs.redistimeseries.RedisTimeSeries
-
public class RedisTimeSeries extends Object
-
-
Constructor Summary
Constructors Constructor Description RedisTimeSeries()Create a new RedisTimeSeries client with default connection to local hostRedisTimeSeries(String host, int port)Create a new RedisTimeSeries clientRedisTimeSeries(String host, int port, int timeout, int poolSize)Create a new RedisTimeSeries clientRedisTimeSeries(String host, int port, int timeout, int poolSize, String password)Create a new RedisTimeSeries clientRedisTimeSeries(redis.clients.jedis.util.Pool<redis.clients.jedis.Jedis> pool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longadd(String sourceKey, double value)TS.ADD key * valuelongadd(String sourceKey, double value, long retentionTime)TS.ADD key * value [RETENTION retentionTime]longadd(String sourceKey, long timestamp, double value)TS.ADD key timestamp valuelongadd(String sourceKey, long timestamp, double value, long retentionTime)TS.ADD key timestamp value [RETENTION retentionTime]longadd(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..]longadd(String sourceKey, long timestamp, double value, long retentionTime, Map<String,String> labels)TS.ADD key timestamp value [RETENTION retentionTime] [LABELS field value..]longadd(String sourceKey, long timestamp, double value, Map<String,String> labels)TS.ADD key timestamp value [RETENTION retentionTime] [LABELS field value..]booleanalter(String key, long retentionTime, Map<String,String> labels)TS.ALTER key [RETENTION retentionTime] [LABELS label value..]booleanalter(String key, Map<String,String> labels)TS.ALTER key [LABELS label value..]booleancreate(String key)TS.CREATE keybooleancreate(String key, long retentionTime)TS.CREATE key [RETENTION retentionTime]booleancreate(String key, long retentionTime, boolean uncompressed, Map<String,String> labels)TS.CREATE key [RETENTION retentionTime] [UNCOMPRESSED] [LABELS field value..]booleancreate(String key, long retentionTime, Map<String,String> labels)TS.CREATE key [RETENTION retentionTime] [LABELS field value..]booleancreate(String key, Map<String,String> labels)TS.CREATE key [LABELS field value..]booleancreateRule(String sourceKey, Aggregation aggregation, long bucketSize, String destKey)TS.CREATERULE sourceKey destKey AGGREGATION aggType retentionTimelongdecrBy(String key, int value)TS.DECRBY key valuelongdecrBy(String key, int value, long timestamp)TS.DECRBY key value [TIMESTAMP timestamp]booleandeleteRule(String sourceKey, String destKey)TS.DELETERULE SOURCE_KEY DEST_KEYValueget(String key)TS.GET keylongincrBy(String key, int value)TS.INCRBY key valuelongincrBy(String key, int value, long timestamp)TS.INCRBY key value [TIMESTAMP timestamp]Infoinfo(String key)TS.INFO keyList<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, int count, String... filters)TS.MRANGE fromTimestamp toTimestamp [COUNT count] 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, String... filters)TS.MRANGE fromTimestamp toTimestamp 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, 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, 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 toTimestampValue[]range(String key, long from, long to, int count)TS.RANGE key fromTimestamp toTimestamp [COUNT count]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[]revrange(String key, long from, long to)TS.REVRANGE key fromTimestamp toTimestampValue[]revrange(String key, long from, long to, int count)TS.REVRANGE key fromTimestamp toTimestamp [COUNT count]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]
-
-
-
Constructor Detail
-
RedisTimeSeries
public RedisTimeSeries()
Create a new RedisTimeSeries client with default connection to local host
-
RedisTimeSeries
public RedisTimeSeries(String host, int port)
Create a new RedisTimeSeries client- Parameters:
host- the redis hostport- the redis pot
-
RedisTimeSeries
public RedisTimeSeries(String host, int port, int timeout, int poolSize)
Create a new RedisTimeSeries client- Parameters:
host- the redis hostport- the redis pot
-
RedisTimeSeries
public RedisTimeSeries(String host, int port, int timeout, int poolSize, String password)
Create a new RedisTimeSeries client- Parameters:
host- the redis hostport- the redis potpassword- the password for authentication in a password protected Redis server
-
RedisTimeSeries
public RedisTimeSeries(redis.clients.jedis.util.Pool<redis.clients.jedis.Jedis> pool)
-
-
Method Detail
-
create
public boolean create(String key)
TS.CREATE key- Parameters:
key-- Returns:
-
create
public boolean create(String key, long retentionTime)
TS.CREATE key [RETENTION retentionTime]- Parameters:
key-retentionTime-- Returns:
-
create
public boolean create(String key, Map<String,String> labels)
TS.CREATE key [LABELS field value..]- Parameters:
key-labels-- Returns:
-
create
public boolean create(String key, long retentionTime, Map<String,String> labels)
TS.CREATE key [RETENTION retentionTime] [LABELS field value..]- Parameters:
key-retentionTime-labels-- Returns:
-
create
public boolean create(String key, long retentionTime, boolean uncompressed, Map<String,String> labels)
TS.CREATE key [RETENTION retentionTime] [UNCOMPRESSED] [LABELS field value..]- Parameters:
key-retentionTime-uncompressed-labels-- Returns:
-
alter
public boolean alter(String key, Map<String,String> labels)
TS.ALTER key [LABELS label value..]- Parameters:
key-labels-- Returns:
-
alter
public boolean alter(String key, long retentionTime, Map<String,String> labels)
TS.ALTER key [RETENTION retentionTime] [LABELS label value..]- Parameters:
key-retentionTime-labels-- Returns:
-
createRule
public boolean createRule(String sourceKey, Aggregation aggregation, long bucketSize, String destKey)
TS.CREATERULE sourceKey destKey AGGREGATION aggType retentionTime- Parameters:
sourceKey-aggregation-bucketSize-destKey-- Returns:
-
deleteRule
public boolean deleteRule(String sourceKey, String destKey)
TS.DELETERULE SOURCE_KEY DEST_KEY- Parameters:
sourceKey-destKey-- Returns:
-
add
public long add(String sourceKey, double value)
TS.ADD key * value- Parameters:
sourceKey-value-- Returns:
-
add
public long add(String sourceKey, long timestamp, double value)
TS.ADD key timestamp value- Parameters:
sourceKey-timestamp-value-- Returns:
-
add
public long add(String sourceKey, long timestamp, double value, long retentionTime)
TS.ADD key timestamp value [RETENTION retentionTime]- Parameters:
sourceKey-timestamp-value-retentionTime-- Returns:
-
add
public long add(String sourceKey, double value, long retentionTime)
TS.ADD key * value [RETENTION retentionTime]- Parameters:
sourceKey-value-retentionTime-- Returns:
-
add
public long add(String sourceKey, long timestamp, double value, Map<String,String> labels)
TS.ADD key timestamp value [RETENTION retentionTime] [LABELS field value..]- Parameters:
sourceKey-timestamp-value-labels-- Returns:
-
add
public long add(String sourceKey, long timestamp, double value, long retentionTime, Map<String,String> labels)
TS.ADD key timestamp value [RETENTION retentionTime] [LABELS field value..]- Parameters:
sourceKey-timestamp-value-retentionTime-labels-- Returns:
-
add
public 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..]- Parameters:
sourceKey-timestamp-value-retentionTime-uncompressed-labels-- Returns:
-
madd
public List<Object> madd(Measurement... measurements)
TS.MADD key timestamp value [key timestamp value ...]- Parameters:
measurements-- Returns:
-
range
public Value[] range(String key, long from, long to)
TS.RANGE key fromTimestamp toTimestamp- Parameters:
key-from-to-- Returns:
-
range
public Value[] range(String key, long from, long to, int count)
TS.RANGE key fromTimestamp toTimestamp [COUNT count]- Parameters:
key-from-to-- Returns:
-
range
public Value[] range(String key, long from, long to, Aggregation aggregation, long timeBucket)
TS.RANGE key fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket]- Parameters:
key-from-to-- Returns:
-
range
public Value[] range(String key, long from, long to, Aggregation aggregation, long timeBucket, int count)
TS.RANGE key fromTimestamp toTimestamp [COUNT count] [AGGREGATION aggregationType timeBucket]- Parameters:
key-from-to-count-- Returns:
-
revrange
public Value[] revrange(String key, long from, long to)
TS.REVRANGE key fromTimestamp toTimestamp- Parameters:
key-from-to-- Returns:
-
revrange
public Value[] revrange(String key, long from, long to, int count)
TS.REVRANGE key fromTimestamp toTimestamp [COUNT count]- Parameters:
key-from-to-count-- Returns:
-
revrange
public Value[] revrange(String key, long from, long to, Aggregation aggregation, long timeBucket)
TS.REVRANGE key fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket]- Parameters:
key-from-to-aggregation-timeBucket-- Returns:
-
revrange
public Value[] revrange(String key, long from, long to, Aggregation aggregation, long timeBucket, int count)
TS.REVRANGE key fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket] [COUNT count]- Parameters:
key-from-to-aggregation-timeBucket-count-- Returns:
-
mrange
public Range[] mrange(long from, long to, String... filters)
TS.MRANGE fromTimestamp toTimestamp FILTER filter. Similar to callingmrange(from, to, null, 0, false, null, filters)- Parameters:
from-to-filters-- Returns:
-
mrange
public Range[] mrange(long from, long to, int count, String... filters)
TS.MRANGE fromTimestamp toTimestamp [COUNT count] FILTER filter. Similar to callingmrange(from, to, null, 0, false, null, filters)- Parameters:
from-to-count-filters-- Returns:
-
mrange
public Range[] mrange(long from, long to, Aggregation aggregation, long timeBucket, String... filters)
TS.MRANGE fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket] FILTER filter. Similar to callingmrange(from, to, aggregation, retentionTime, false, null, filters)- Parameters:
from-to-aggregation-timeBucket-filters-- Returns:
-
mrange
public Range[] mrange(long from, long to, Aggregation aggregation, long timeBucket, boolean withLabels, String... filters)
TS.MRANGE fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket] FILTER filter. Similar to callingmrange(from, to, aggregation, retentionTime, false, null, filters)- Parameters:
from-to-aggregation-timeBucket-filters-- Returns:
-
mrange
public 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. Similar to callingmrange(from, to, aggregation, retentionTime, false, null, filters)- Parameters:
from-to-aggregation-timeBucket-filters-count-- Returns:
-
mrevrange
public Range[] mrevrange(long from, long to, String... filters)
TS.MREVRANGE fromTimestamp toTimestamp FILTER filter. Similar to callingmrevrange(from, to, null, 0, false, null, filters)- Parameters:
from-to-filters-- Returns:
-
mrevrange
public Range[] mrevrange(long from, long to, int count, String... filters)
TS.MREVRANGE fromTimestamp toTimestamp [COUNT count] FILTER filter. Similar to callingmrevrange(from, to, null, 0, false, null, filters)- Parameters:
from-to-count-filters-- Returns:
-
mrevrange
public Range[] mrevrange(long from, long to, Aggregation aggregation, long timeBucket, String... filters)
TS.MREVRANGE fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket] FILTER filter. Similar to callingmrevrange(from, to, aggregation, retentionTime, false, null, filters)- Parameters:
from-to-aggregation-timeBucket-filters-- Returns:
-
mrevrange
public Range[] mrevrange(long from, long to, Aggregation aggregation, long timeBucket, boolean withLabels, String... filters)
TS.MREVRANGE fromTimestamp toTimestamp [AGGREGATION aggregationType timeBucket] FILTER filter. Similar to callingmrevrange(from, to, aggregation, retentionTime, false, null, filters)- Parameters:
from-to-aggregation-timeBucket-filters-- Returns:
-
mrevrange
public 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..- Parameters:
from-to-aggregation-timeBucket-withLabels-trueif the labels should be returned for each rangecount-filters-- Returns:
-
mget
public Range[] mget(boolean withLabels, String... filters)
TS.MGET [WITHLABELS] FILTER filter...- Parameters:
withLabels-filters-- Returns:
-
incrBy
public long incrBy(String key, int value)
TS.INCRBY key value- Parameters:
key-value-- Returns:
-
incrBy
public long incrBy(String key, int value, long timestamp)
TS.INCRBY key value [TIMESTAMP timestamp]- Parameters:
key-value-timestamp-- Returns:
-
decrBy
public long decrBy(String key, int value)
TS.DECRBY key value- Parameters:
key-value-- Returns:
-
decrBy
public long decrBy(String key, int value, long timestamp)
TS.DECRBY key value [TIMESTAMP timestamp]- Parameters:
key-value-timestamp-- Returns:
-
-