/** * @param recoveryDescs Recovery descriptors to cleanup. */ private void cleanupRecovery(ConcurrentMap<ConnectionKey, GridNioRecoveryDescriptor> recoveryDescs) { Set<ConnectionKey> left = null; for (Map.Entry<ConnectionKey, GridNioRecoveryDescriptor> e : recoveryDescs.entrySet()) { if (left != null && left.contains(e.getKey())) continue; GridNioRecoveryDescriptor recoveryDesc = e.getValue(); if (!recoveryDesc.nodeAlive(getSpiContext().node(e.getKey().nodeId()))) { if (left == null) left = new HashSet<>(); left.add(e.getKey()); } } if (left != null) { assert !left.isEmpty(); for (ConnectionKey id : left) { GridNioRecoveryDescriptor recoveryDesc = recoveryDescs.get(id); if (recoveryDesc != null && recoveryDesc.onNodeLeft()) recoveryDescs.remove(id, recoveryDesc); } } }
/** * @param recoveryDescs Recovery descriptors to cleanup. */ private void cleanupRecovery(ConcurrentMap<ConnectionKey, GridNioRecoveryDescriptor> recoveryDescs) { Set<ConnectionKey> left = null; for (Map.Entry<ConnectionKey, GridNioRecoveryDescriptor> e : recoveryDescs.entrySet()) { if (left != null && left.contains(e.getKey())) continue; GridNioRecoveryDescriptor recoveryDesc = e.getValue(); if (!recoveryDesc.nodeAlive(getSpiContext().node(e.getKey().nodeId()))) { if (left == null) left = new HashSet<>(); left.add(e.getKey()); } } if (left != null) { assert !left.isEmpty(); for (ConnectionKey id : left) { GridNioRecoveryDescriptor recoveryDesc = recoveryDescs.get(id); if (recoveryDesc != null && recoveryDesc.onNodeLeft()) recoveryDescs.remove(id, recoveryDesc); } } }