List of usage examples for java.util.concurrent DelayQueue contains
boolean contains(Object o);
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); } }