Package org.redisson

Class RedissonPriorityQueue<V>

    • Method Detail

      • offer

        public boolean offer​(V e)
        Specified by:
         in interface <V>
      • contains

        public boolean contains​( o)
        Specified by:
         in interface <V>
        Specified by:
         in interface <V>
        Overrides:
        contains in class RedissonList<V>
      • add

        public boolean add​(V value)
        Specified by:
         in interface <V>
        Specified by:
         in interface <V>
        Specified by:
         in interface <V>
        Overrides:
        add in class RedissonList<V>
      • remove

        public boolean remove​( value)
        Specified by:
         in interface <V>
        Specified by:
         in interface <V>
        Overrides:
        remove in class RedissonList<V>
      • containsAll

        public boolean containsAll​(<?> c)
        Specified by:
         in interface <V>
        Specified by:
         in interface <V>
        Overrides:
        containsAll in class RedissonList<V>
      • addAll

        public boolean addAll​(<? extends V> c)
        Specified by:
         in interface <V>
        Specified by:
         in interface <V>
        Overrides:
        addAll in class RedissonList<V>
      • retainAll

        public boolean retainAll​(<?> c)
        Specified by:
         in interface <V>
        Specified by:
         in interface <V>
        Overrides:
        retainAll in class RedissonList<V>
      • removeAll

        public boolean removeAll​(<?> c)
        Specified by:
         in interface <V>
        Specified by:
         in interface <V>
        Overrides:
        removeAll in class RedissonList<V>
      • clear

        public void clear()
        Specified by:
         in interface <V>
        Specified by:
         in interface <V>
        Overrides:
        clear in class RedissonList<V>
      • comparator

        public <? super V> comparator()
        Description copied from interface: RPriorityQueue
        Returns comparator used by this queue
        Specified by:
        comparator in interface RPriorityQueue<V>
        Returns:
        comparator object
      • pollAsync

        public RFuture<V> pollAsync()
        Description copied from interface: RQueueAsync
        Retrieves and removes the head of this queue in async mode.
        Specified by:
        pollAsync in interface RQueueAsync<V>
        Returns:
        the head of this queue, or null
      • wrapLockedAsync

        protected <T> RFuture<V> wrapLockedAsync​(RedisCommand<T> command,
                                                 ... params)
      • wrapLockedAsync

        protected final <T,​R> <RFuture<R>> callable)
      • getFirst

        public V getFirst()
      • poll

        public V poll()
        Specified by:
         in interface <V>
      • element

        public V element()
        Specified by:
         in interface <V>
      • peekAsync

        public RFuture<V> peekAsync()
        Description copied from interface: RQueueAsync
        Retrieves the head of this queue in async mode.
        Specified by:
        peekAsync in interface RQueueAsync<V>
        Returns:
        the head of this queue, or null
      • peek

        public V peek()
        Specified by:
         in interface <V>
      • trySetComparator

        public boolean trySetComparator​(<? super V> comparator)
        Description copied from interface: RPriorityQueue
        Sets new comparator only if current set is empty
        Specified by:
        trySetComparator in interface RPriorityQueue<V>
        Parameters:
        comparator - for values
        Returns:
        true if new comparator setted false otherwise
      • remove

        public V remove()
        Specified by:
         in interface <V>
      • removeFirst

        public V removeFirst()
      • pollLastAndOfferFirstTo

        public  queueName)
        Description copied from interface: RPriorityQueue
        Retrieves and removes last available tail element of this queue queue and adds it at the head of queueName.
        Specified by:
        pollLastAndOfferFirstTo in interface RPriorityQueue<V>
        Specified by:
        pollLastAndOfferFirstTo in interface RQueue<V>
        Parameters:
        queueName - - names of destination queue
        Returns:
        the tail of this queue, or null if the specified waiting time elapses before an element is available
      • pollLastAndOfferFirstToAsync

        public  queueName)
        Description copied from interface: RQueueAsync
        Retrieves and removes last available tail element of this queue queue and adds it at the head of queueName.
        Specified by:
        pollLastAndOfferFirstToAsync in interface RQueueAsync<V>
        Parameters:
        queueName - - names of destination queue
        Returns:
        the tail of this queue, or null if the specified waiting time elapses before an element is available
      • expireAsync

        public > expireAsync​(long timeToLive,
                                             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
      • expireAtAsync

        protected > expireAtAsync​(long timestamp,
                                                 ... keys)
      • clearExpireAsync

        public > 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
      • poll

        public <V> poll​(int limit)
        Description copied from interface: RQueue
        Retrieves and removes the head elements of this queue. Elements amount limited by limit param.
        Specified by:
        poll in interface RQueue<V>
        Returns:
        list of head elements
      • offerAsync

        public > offerAsync​(V e)
        Description copied from interface: RQueueAsync
        Inserts the specified element into this queue.
        Specified by:
        offerAsync in interface RQueueAsync<V>
        Parameters:
        e - the element to add
        Returns:
        true if successful, or false
      • addAsync

        public > addAsync​(V e)
        Description copied from interface: RCollectionAsync
        Adds element into this collection.
        Specified by:
        addAsync in interface RCollectionAsync<V>
        Overrides:
        addAsync in class RedissonList<V>
        Parameters:
        e - - element to add
        Returns:
        true if an element was added and false if it is already present
      • pollAsync

        public <V>> pollAsync​(int limit)
        Description copied from interface: RQueueAsync
        Retrieves and removes the head elements of this queue. Elements amount limited by limit param.
        Specified by:
        pollAsync in interface RQueueAsync<V>
        Returns:
        list of head elements
      • expire

        public boolean expire​(long timeToLive,
                               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)
        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 > expireAsync​( 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
      • expireAt

        public boolean expireAt​( timestamp)
        Description copied from interface: RExpirable
        Specified by:
        expireAt in interface RExpirable
        Parameters:
        timestamp - - 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 > 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.
      • expireAsync

        protected > expireAsync​(long timeToLive,
                                                timeUnit,
                                               ... keys)
      • clearExpireAsync

        protected > clearExpireAsync​(... keys)