Search in sources :

Example 1 with Long2ObjectHashMap

use of com.hazelcast.internal.util.collection.Long2ObjectHashMap in project hazelcast by hazelcast.

the class AbstractBlockingService method onSessionClose.

@Override
public final void onSessionClose(CPGroupId groupId, long sessionId) {
    ResourceRegistry<W, R> registry = registries.get(groupId);
    if (registry == null) {
        if (logger.isFineEnabled()) {
            logger.fine("Resource registry of " + groupId + " not found to handle closed Session[" + sessionId + "]");
        }
        return;
    }
    List<Long> expiredWaitKeys = new ArrayList<>();
    Long2ObjectHashMap<Object> completedWaitKeys = new Long2ObjectHashMap<>();
    registry.closeSession(sessionId, expiredWaitKeys, completedWaitKeys);
    if (logger.isFineEnabled() && (expiredWaitKeys.size() > 0 || completedWaitKeys.size() > 0)) {
        logger.fine("Closed Session[" + sessionId + "] in " + groupId + " expired wait key commit indices: " + expiredWaitKeys + " completed wait keys: " + completedWaitKeys);
    }
    completeFutures(groupId, expiredWaitKeys, new SessionExpiredException());
    raftService.completeFutures(groupId, completedWaitKeys.entrySet());
}
Also used : ArrayList(java.util.ArrayList) Long2ObjectHashMap(com.hazelcast.internal.util.collection.Long2ObjectHashMap) SessionExpiredException(com.hazelcast.cp.internal.session.SessionExpiredException)

Aggregations

SessionExpiredException (com.hazelcast.cp.internal.session.SessionExpiredException)1 Long2ObjectHashMap (com.hazelcast.internal.util.collection.Long2ObjectHashMap)1 ArrayList (java.util.ArrayList)1