class UGICache {

    @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
    public UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser) throws IOException {
        Integer segmentId = session.getSegmentId();
        String user = session.getUser();
        DelayQueue<Entry> delayQueue = getExpirationQueue(segmentId);
        synchronized (delayQueue) {
            // Use the opportunity to cleanup any expired entries
            cleanup(delayQueue);
            Entry entry = cache.get(session);
            if (entry == null) {

                UserGroupInformation ugi;
                if (isProxyUser) {
                    LOG.debug("{} Creating proxy user = {}", session, user);
                    ugi = ugiProvider.createProxyUGI(user, session.getLoginUser());
                } else {
                    LOG.debug("{} Creating remote user = {}", session, user);
                    ugi = ugiProvider.createRemoteUser(user, session);
                }
                entry = new Entry(ticker, ugi, session);
                delayQueue.offer(entry);
                cache.put(session, entry);
            }
            entry.incrementRefCount();
            return entry.getUGI();
        }
    }

      UGICache(UGIProvider provider, Ticker ticker);
    public  UGICache();

}