Package org.redisson

Class RedissonTimeSeries<V>

    • Method Detail

      • add

        public void add(long timestamp,
                        V value)
        Description copied from interface: RTimeSeries
        Adds element to this time-series collection by specified timestamp.
        Specified by:
        add in interface RTimeSeries<V>
        Parameters:
        timestamp - - object timestamp
        value - - object itself
      • addAsync

        public RFuture<Void> addAsync(long timestamp,
                                      V object)
        Description copied from interface: RTimeSeriesAsync
        Adds element to this time-series collection by specified timestamp.
        Specified by:
        addAsync in interface RTimeSeriesAsync<V>
        Parameters:
        timestamp - - object timestamp
        object - - object itself
        Returns:
        void
      • addAll

        public void addAll(Map<Long,V> objects)
        Description copied from interface: RTimeSeries
        Adds all elements contained in the specified map to this time-series collection. Map contains of timestamp mapped by object.
        Specified by:
        addAll in interface RTimeSeries<V>
        Parameters:
        objects - - map of elements to add
      • add

        public void add(long timestamp,
                        V value,
                        long timeToLive,
                        TimeUnit timeUnit)
        Description copied from interface: RTimeSeries
        Adds element to this time-series collection by specified timestamp.
        Specified by:
        add in interface RTimeSeries<V>
        Parameters:
        timestamp - - object timestamp
        value - - object itself
        timeToLive - - time to live interval
        timeUnit - - unit of time to live interval
      • addAsync

        public RFuture<Void> addAsync(long timestamp,
                                      V object,
                                      long timeToLive,
                                      TimeUnit timeUnit)
        Description copied from interface: RTimeSeriesAsync
        Adds element to this time-series collection by specified timestamp.
        Specified by:
        addAsync in interface RTimeSeriesAsync<V>
        Parameters:
        timestamp - - object timestamp
        object - - object itself
        timeToLive - - time to live interval
        timeUnit - - unit of time to live interval
        Returns:
        void
      • addAll

        public void addAll(Map<Long,V> objects,
                           long timeToLive,
                           TimeUnit timeUnit)
        Description copied from interface: RTimeSeries
        Adds all elements contained in the specified map to this time-series collection. Map contains of timestamp mapped by object.
        Specified by:
        addAll in interface RTimeSeries<V>
        Parameters:
        objects - - map of elements to add
        timeToLive - - time to live interval
        timeUnit - - unit of time to live interval
      • addAllAsync

        public RFuture<Void> addAllAsync(Map<Long,V> objects)
        Description copied from interface: RTimeSeriesAsync
        Adds all elements contained in the specified map to this time-series collection. Map contains of timestamp mapped by object.
        Specified by:
        addAllAsync in interface RTimeSeriesAsync<V>
        Parameters:
        objects - - map of elements to add
        Returns:
        void
      • addAllAsync

        public RFuture<Void> addAllAsync(Map<Long,V> objects,
                                         long timeToLive,
                                         TimeUnit timeUnit)
        Description copied from interface: RTimeSeriesAsync
        Adds all elements contained in the specified map to this time-series collection. Map contains of timestamp mapped by object.
        Specified by:
        addAllAsync in interface RTimeSeriesAsync<V>
        Parameters:
        objects - - map of elements to add
        timeToLive - - time to live interval
        timeUnit - - unit of time to live interval
        Returns:
        void
      • size

        public int size()
        Description copied from interface: RTimeSeries
        Returns size of this set.
        Specified by:
        size in interface RTimeSeries<V>
        Returns:
        size
      • get

        public V get(long timestamp)
        Description copied from interface: RTimeSeries
        Returns object by specified timestamp or null if it doesn't exist.
        Specified by:
        get in interface RTimeSeries<V>
        Parameters:
        timestamp - - object timestamp
        Returns:
        object
      • getAsync

        public RFuture<V> getAsync(long timestamp)
        Description copied from interface: RTimeSeriesAsync
        Returns object by specified timestamp or null if it doesn't exist.
        Specified by:
        getAsync in interface RTimeSeriesAsync<V>
        Parameters:
        timestamp - - object timestamp
        Returns:
        object
      • remove

        public boolean remove(long timestamp)
        Description copied from interface: RTimeSeries
        Removes object by specified timestamp.
        Specified by:
        remove in interface RTimeSeries<V>
        Parameters:
        timestamp - - object timestamp
        Returns:
        true if an element was removed as a result of this call
      • removeAsync

        public RFuture<Boolean> removeAsync(long timestamp)
        Description copied from interface: RTimeSeriesAsync
        Removes object by specified timestamp.
        Specified by:
        removeAsync in interface RTimeSeriesAsync<V>
        Parameters:
        timestamp - - object timestamp
        Returns:
        true if an element was removed as a result of this call
      • last

        public V last()
        Description copied from interface: RTimeSeries
        Returns the tail element or null if this time-series collection is empty.
        Specified by:
        last in interface RTimeSeries<V>
        Returns:
        the tail element or null if this time-series collection is empty
      • lastAsync

        public RFuture<V> lastAsync()
        Description copied from interface: RTimeSeriesAsync
        Returns the tail element or null if this time-series collection is empty.
        Specified by:
        lastAsync in interface RTimeSeriesAsync<V>
        Returns:
        the tail element or null if this time-series collection is empty
      • lastAsync

        public RFuture<Collection<V>> lastAsync(int count)
        Description copied from interface: RTimeSeriesAsync
        Returns the tail elements of this time-series collection.
        Specified by:
        lastAsync in interface RTimeSeriesAsync<V>
        Parameters:
        count - - elements amount
        Returns:
        the tail elements
      • first

        public V first()
        Description copied from interface: RTimeSeries
        Returns the head element or null if this time-series collection is empty.
        Specified by:
        first in interface RTimeSeries<V>
        Returns:
        the head element or null if this time-series collection is empty
      • firstAsync

        public RFuture<V> firstAsync()
        Description copied from interface: RTimeSeriesAsync
        Returns the head element or null if this time-series collection is empty.
        Specified by:
        firstAsync in interface RTimeSeriesAsync<V>
        Returns:
        the head element or null if this time-series collection is empty
      • first

        public Collection<V> first(int count)
        Description copied from interface: RTimeSeries
        Returns the head elements of this time-series collection.
        Specified by:
        first in interface RTimeSeries<V>
        Parameters:
        count - - elements amount
        Returns:
        the head elements
      • last

        public Collection<V> last(int count)
        Description copied from interface: RTimeSeries
        Returns the tail elements of this time-series collection.
        Specified by:
        last in interface RTimeSeries<V>
        Parameters:
        count - - elements amount
        Returns:
        the tail elements
      • firstTimestamp

        public Long firstTimestamp()
        Description copied from interface: RTimeSeries
        Returns timestamp of the head timestamp or null if this time-series collection is empty.
        Specified by:
        firstTimestamp in interface RTimeSeries<V>
        Returns:
        timestamp or null if this time-series collection is empty
      • firstTimestampAsync

        public RFuture<Long> firstTimestampAsync()
        Description copied from interface: RTimeSeriesAsync
        Returns timestamp of the head timestamp or null if this time-series collection is empty.
        Specified by:
        firstTimestampAsync in interface RTimeSeriesAsync<V>
        Returns:
        timestamp or null if this time-series collection is empty
      • lastTimestamp

        public Long lastTimestamp()
        Description copied from interface: RTimeSeries
        Returns timestamp of the tail element or null if this time-series collection is empty.
        Specified by:
        lastTimestamp in interface RTimeSeries<V>
        Returns:
        timestamp or null if this time-series collection is empty
      • lastTimestampAsync

        public RFuture<Long> lastTimestampAsync()
        Description copied from interface: RTimeSeriesAsync
        Returns timestamp of the tail element or null if this time-series collection is empty.
        Specified by:
        lastTimestampAsync in interface RTimeSeriesAsync<V>
        Returns:
        timestamp or null if this time-series collection is empty
      • removeRange

        public int removeRange(long startTimestamp,
                               long endTimestamp)
        Description copied from interface: RTimeSeries
        Removes values within timestamp range. Including boundary values.
        Specified by:
        removeRange in interface RTimeSeries<V>
        Parameters:
        startTimestamp - - start timestamp
        endTimestamp - - end timestamp
        Returns:
        number of removed elements
      • removeRangeAsync

        public RFuture<Integer> removeRangeAsync(long startTimestamp,
                                                 long endTimestamp)
        Description copied from interface: RTimeSeriesAsync
        Removes values within timestamp range. Including boundary values.
        Specified by:
        removeRangeAsync in interface RTimeSeriesAsync<V>
        Parameters:
        startTimestamp - - start timestamp
        endTimestamp - - end timestamp
        Returns:
        number of removed elements
      • range

        public Collection<V> range(long startTimestamp,
                                   long endTimestamp)
        Description copied from interface: RTimeSeries
        Returns ordered elements of this time-series collection within timestamp range. Including boundary values.
        Specified by:
        range in interface RTimeSeries<V>
        Parameters:
        startTimestamp - - start timestamp
        endTimestamp - - end timestamp
        Returns:
        elements collection
      • entryRange

        public Collection<TimeSeriesEntry<V>> entryRange(long startTimestamp,
                                                         long endTimestamp)
        Description copied from interface: RTimeSeries
        Returns ordered entries of this time-series collection within timestamp range. Including boundary values.
        Specified by:
        entryRange in interface RTimeSeries<V>
        Parameters:
        startTimestamp - - start timestamp
        endTimestamp - - end timestamp
        Returns:
        elements collection
      • entryRangeReversed

        public Collection<TimeSeriesEntry<V>> entryRangeReversed(long startTimestamp,
                                                                 long endTimestamp)
        Description copied from interface: RTimeSeries
        Returns entries of this time-series collection in reverse order within timestamp range. Including boundary values.
        Specified by:
        entryRangeReversed in interface RTimeSeries<V>
        Parameters:
        startTimestamp - - start timestamp
        endTimestamp - - end timestamp
        Returns:
        elements collection
      • entryRangeReversedAsync

        public RFuture<Collection<TimeSeriesEntry<V>>> entryRangeReversedAsync(long startTimestamp,
                                                                               long endTimestamp)
        Description copied from interface: RTimeSeriesAsync
        Returns entries of this time-series collection in reverse order within timestamp range. Including boundary values.
        Specified by:
        entryRangeReversedAsync in interface RTimeSeriesAsync<V>
        Parameters:
        startTimestamp - - start timestamp
        endTimestamp - - end timestamp
        Returns:
        elements collection
      • entryRangeAsync

        public RFuture<Collection<TimeSeriesEntry<V>>> entryRangeAsync(long startTimestamp,
                                                                       long endTimestamp)
        Description copied from interface: RTimeSeriesAsync
        Returns ordered entries of this time-series collection within timestamp range. Including boundary values.
        Specified by:
        entryRangeAsync in interface RTimeSeriesAsync<V>
        Parameters:
        startTimestamp - - start timestamp
        endTimestamp - - end timestamp
        Returns:
        elements collection
      • rangeAsync

        public RFuture<Collection<V>> rangeAsync(long startTimestamp,
                                                 long endTimestamp)
        Description copied from interface: RTimeSeriesAsync
        Returns ordered elements of this time-series collection within timestamp range. Including boundary values.
        Specified by:
        rangeAsync in interface RTimeSeriesAsync<V>
        Parameters:
        startTimestamp - - start timestamp
        endTimestamp - - end timestamp
        Returns:
        elements collection
      • rangeReversed

        public Collection<V> rangeReversed(long startTimestamp,
                                           long endTimestamp)
        Description copied from interface: RTimeSeries
        Returns elements of this time-series collection in reverse order within timestamp range. Including boundary values.
        Specified by:
        rangeReversed in interface RTimeSeries<V>
        Parameters:
        startTimestamp - - start timestamp
        endTimestamp - - end timestamp
        Returns:
        elements collection
      • rangeReversedAsync

        public RFuture<Collection<V>> rangeReversedAsync(long startTimestamp,
                                                         long endTimestamp)
        Description copied from interface: RTimeSeriesAsync
        Returns elements of this time-series collection in reverse order within timestamp range. Including boundary values.
        Specified by:
        rangeReversedAsync in interface RTimeSeriesAsync<V>
        Parameters:
        startTimestamp - - start timestamp
        endTimestamp - - end timestamp
        Returns:
        elements collection
      • pollFirst

        public Collection<V> pollFirst(int count)
        Description copied from interface: RTimeSeries
        Removes and returns the head elements or null if this time-series collection is empty.
        Specified by:
        pollFirst in interface RTimeSeries<V>
        Parameters:
        count - - elements amount
        Returns:
        the head element, or null if this time-series collection is empty
      • pollLast

        public Collection<V> pollLast(int count)
        Description copied from interface: RTimeSeries
        Removes and returns the tail elements or null if this time-series collection is empty.
        Specified by:
        pollLast in interface RTimeSeries<V>
        Parameters:
        count - - elements amount
        Returns:
        the tail element or null if this time-series collection is empty
      • pollFirstAsync

        public RFuture<Collection<V>> pollFirstAsync(int count)
        Description copied from interface: RTimeSeriesAsync
        Removes and returns the head elements or null if this time-series collection is empty.
        Specified by:
        pollFirstAsync in interface RTimeSeriesAsync<V>
        Parameters:
        count - - elements amount
        Returns:
        the head element, or null if this time-series collection is empty
      • pollLastAsync

        public RFuture<Collection<V>> pollLastAsync(int count)
        Description copied from interface: RTimeSeriesAsync
        Removes and returns the tail elements or null if this time-series collection is empty.
        Specified by:
        pollLastAsync in interface RTimeSeriesAsync<V>
        Parameters:
        count - - elements amount
        Returns:
        the tail element or null if this time-series collection is empty
      • pollFirst

        public V pollFirst()
        Description copied from interface: RTimeSeries
        Removes and returns the head element or null if this time-series collection is empty.
        Specified by:
        pollFirst in interface RTimeSeries<V>
        Returns:
        the head element, or null if this time-series collection is empty
      • pollLast

        public V pollLast()
        Description copied from interface: RTimeSeries
        Removes and returns the tail element or null if this time-series collection is empty.
        Specified by:
        pollLast in interface RTimeSeries<V>
        Returns:
        the tail element or null if this time-series collection is empty
      • pollFirstAsync

        public RFuture<V> pollFirstAsync()
        Description copied from interface: RTimeSeriesAsync
        Removes and returns the head element or null if this time-series collection is empty.
        Specified by:
        pollFirstAsync in interface RTimeSeriesAsync<V>
        Returns:
        the head element, or null if this time-series collection is empty
      • pollLastAsync

        public RFuture<V> pollLastAsync()
        Description copied from interface: RTimeSeriesAsync
        Removes and returns the tail element or null if this time-series collection is empty.
        Specified by:
        pollLastAsync in interface RTimeSeriesAsync<V>
        Returns:
        the tail element or null if this time-series collection is empty
      • iterator

        public Iterator<V> iterator(int count)
        Description copied from interface: RTimeSeries
        Returns an iterator over elements in this time-series collection. Elements are loaded in batch. Batch size is defined by count param.
        Specified by:
        iterator in interface RTimeSeries<V>
        Parameters:
        count - - size of elements batch
        Returns:
        iterator
      • stream

        public Stream<V> stream()
        Description copied from interface: RTimeSeries
        Returns stream of elements in this time-series collection. Elements are loaded in batch. Batch size is 10.
        Specified by:
        stream in interface RTimeSeries<V>
        Returns:
        stream of elements
      • stream

        public Stream<V> stream(int count)
        Description copied from interface: RTimeSeries
        Returns stream of elements in this time-series collection. Elements are loaded in batch. Batch size is defined by count param.
        Specified by:
        stream in interface RTimeSeries<V>
        Parameters:
        count - - size of elements batch
        Returns:
        stream of elements
      • destroy

        public void destroy()
        Description copied from interface: RDestroyable
        Destroys object when it's not necessary anymore.
        Specified by:
        destroy in interface RDestroyable
      • expireAsync

        public RFuture<Boolean> expireAsync(long timeToLive,
                                            TimeUnit timeUnit)
        Description copied from interface: RExpirableAsync
        Set a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.
        Specified by:
        expireAsync in interface RExpirableAsync
        Parameters:
        timeToLive - - timeout before object will be deleted
        timeUnit - - timeout time unit
        Returns:
        true if the timeout was set and false if not
      • clearExpireAsync

        public RFuture<Boolean> clearExpireAsync()
        Description copied from interface: RExpirableAsync
        Clear an expire timeout or expire date for object in async mode. Object will not be deleted.
        Specified by:
        clearExpireAsync in interface RExpirableAsync
        Returns:
        true if the timeout was cleared and false if not
      • expire

        public boolean expire(long timeToLive,
                              TimeUnit timeUnit)
        Description copied from interface: RExpirable
        Set a timeout for object. After the timeout has expired, the key will automatically be deleted.
        Specified by:
        expire in interface RExpirable
        Parameters:
        timeToLive - - timeout before object will be deleted
        timeUnit - - timeout time unit
        Returns:
        true if the timeout was set and false if not
      • expireAt

        public boolean expireAt(long timestamp)
        Description copied from interface: RExpirable
        Specified by:
        expireAt in interface RExpirable
        Parameters:
        timestamp - - expire date in milliseconds (Unix timestamp)
        Returns:
        true if the timeout was set and false if not
      • expire

        public boolean expire(Instant instant)
        Description copied from interface: RExpirable
        Set an expire date for object. When expire date comes the key will automatically be deleted.
        Specified by:
        expire in interface RExpirable
        Parameters:
        instant - - expire date
        Returns:
        true if the timeout was set and false if not
      • expireAsync

        public RFuture<Boolean> expireAsync(Instant instant)
        Description copied from interface: RExpirableAsync
        Set an expire date for object. When expire date comes the key will automatically be deleted.
        Specified by:
        expireAsync in interface RExpirableAsync
        Parameters:
        instant - - expire date
        Returns:
        true if the timeout was set and false if not
      • clearExpire

        public boolean clearExpire()
        Description copied from interface: RExpirable
        Clear an expire timeout or expire date for object.
        Specified by:
        clearExpire in interface RExpirable
        Returns:
        true if timeout was removed false if object does not exist or does not have an associated timeout
      • remainTimeToLive

        public long remainTimeToLive()
        Description copied from interface: RExpirable
        Remaining time to live of Redisson object that has a timeout
        Specified by:
        remainTimeToLive in interface RExpirable
        Returns:
        time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
      • remainTimeToLiveAsync

        public RFuture<Long> remainTimeToLiveAsync()
        Description copied from interface: RExpirableAsync
        Remaining time to live of Redisson object that has a timeout
        Specified by:
        remainTimeToLiveAsync in interface RExpirableAsync
        Returns:
        time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.