Class RedisTimeSeries


  • public class RedisTimeSeries
    extends Object
    • Constructor Summary

      Constructors 
      Constructor Description
      RedisTimeSeries()
      Create a new RedisTimeSeries client with default connection to local 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
      RedisTimeSeries​(redis.clients.jedis.util.Pool<redis.clients.jedis.Jedis> pool)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long add​(String sourceKey, double value)
      TS.ADD key * 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, long retentionTime)
      TS.ADD key timestamp value [RETENTION retentionTime]
      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..]
      boolean create​(String key)
      TS.CREATE key
      boolean create​(String key, long retentionTime)
      TS.CREATE key [RETENTION retentionTime]
      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]
      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, 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 toTimestamp
      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, 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 toTimestamp
      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, 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 host
        port - the redis pot
      • RedisTimeSeries

        public RedisTimeSeries​(String host,
                               int port,
                               int timeout,
                               int poolSize)
        Create a new RedisTimeSeries client
        Parameters:
        host - the redis host
        port - 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 host
        port - the redis pot
        password - 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 calling mrange(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 calling mrange(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 calling mrange(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 calling mrange(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 calling mrange(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 calling mrevrange(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 calling mrevrange(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 calling mrevrange(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 calling mrevrange(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 - true if the labels should be returned for each range
        count -
        filters -
        Returns:
      • get

        public Value get​(String key)
        TS.GET key
        Parameters:
        key -
        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:
      • queryIndex

        public String[] queryIndex​(String... filters)
        TS.QUERYINDEX filter...
      • info

        public Info info​(String key)
        TS.INFO key
        Parameters:
        key -
        Returns: