Example usage for java.util.concurrent DelayQueue contains

List of usage examples for java.util.concurrent DelayQueue contains

Introduction

In this page you can find the example usage for java.util.concurrent DelayQueue contains.

Prototype

boolean contains(Object o);

Source Link

Document

Returns true if this queue contains the specified element.

Usage

From source file:org.apache.hawq.pxf.service.UGICache.java

/**
 * This method is O(n) in the number of cache entries and should only be called in tests.
 *
 * @param session/*  w w  w .  ja v  a  2  s.c  o  m*/
 * @return determine whether the session is in the internal cache
 */
boolean contains(SessionId session) {
    DelayQueue<Entry> expirationQueue = getExpirationQueue(session.getSegmentId());
    synchronized (expirationQueue) {
        Entry entry = cache.get(session);
        return entry != null && expirationQueue.contains(entry);
    }
}