@Test(expected = IllegalStateException.class) public void releaseAnEntryNotInTheCache() { cache.release(session, false); }
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") public void release(SessionId session, boolean cleanImmediatelyIfNoRefs) { Entry entry = cache.get(session); if (entry == null) { throw new IllegalStateException("Cannot release UGI for this session; it is not cached: " + session); } DelayQueue<Entry> expirationQueue = getExpirationQueue(session.getSegmentId()); synchronized (expirationQueue) { entry.decrementRefCount(); expirationQueue.remove(entry); if (cleanImmediatelyIfNoRefs && entry.isNotInUse()) { closeUGI(entry); } else { entry.resetTime(); expirationQueue.offer(entry); } } }
UGICache { @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") public void release(SessionId session, boolean cleanImmediatelyIfNoRefs) { Entry entry = cache.get(session); if (entry == null) { throw new IllegalStateException("Cannot release UGI for this session; it is not cached: " + session); } DelayQueue<Entry> expirationQueue = getExpirationQueue(session.getSegmentId()); synchronized (expirationQueue) { entry.decrementRefCount(); expirationQueue.remove(entry); if (cleanImmediatelyIfNoRefs && entry.isNotInUse()) { closeUGI(entry); } else { entry.resetTime(); expirationQueue.offer(entry); } } } }
UGICache { @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") public void release(SessionId session, boolean cleanImmediatelyIfNoRefs) { Entry entry = cache.get(session); if (entry == null) { throw new IllegalStateException("Cannot release UGI for this session; it is not cached: " + session); } DelayQueue<Entry> expirationQueue = getExpirationQueue(session.getSegmentId()); synchronized (expirationQueue) { entry.decrementRefCount(); expirationQueue.remove(entry); if (cleanImmediatelyIfNoRefs && entry.isNotInUse()) { closeUGI(entry); } else { entry.resetTime(); expirationQueue.offer(entry); } } } UGICache(UGIProvider provider, Ticker ticker);  UGICache(); }
UGICache { @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") public void release(SessionId session, boolean cleanImmediatelyIfNoRefs) { Entry entry = cache.get(session); if (entry == null) { throw new IllegalStateException("Cannot release UGI for this session; it is not cached: " + session); } DelayQueue<Entry> expirationQueue = getExpirationQueue(session.getSegmentId()); synchronized (expirationQueue) { entry.decrementRefCount(); expirationQueue.remove(entry); if (cleanImmediatelyIfNoRefs && entry.isNotInUse()) { closeUGI(entry); } else { entry.resetTime(); expirationQueue.offer(entry); } } } UGICache(UGIProvider provider, Ticker ticker);  UGICache(); @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser); @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") void release(SessionId session, boolean cleanImmediatelyIfNoRefs); }
UGICache { @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") public void release(SessionId session, boolean cleanImmediatelyIfNoRefs) { Entry entry = cache.get(session); if (entry == null) { throw new IllegalStateException("Cannot release UGI for this session; it is not cached: " + session); } DelayQueue<Entry> expirationQueue = getExpirationQueue(session.getSegmentId()); synchronized (expirationQueue) { entry.decrementRefCount(); expirationQueue.remove(entry); if (cleanImmediatelyIfNoRefs && entry.isNotInUse()) { closeUGI(entry); } else { entry.resetTime(); expirationQueue.offer(entry); } } } UGICache(UGIProvider provider, Ticker ticker);  UGICache(); @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser); @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") void release(SessionId session, boolean cleanImmediatelyIfNoRefs);  }