/** {@inheritDoc} */ @Override public boolean onDone(@Nullable Void res, @Nullable Throwable err) { if (super.onDone(res, err)) { cctx.mvcc().removeAtomicFuture(version()); if (updateReq.writeSynchronizationMode() == FULL_SYNC) completionCb.apply(updateReq, updateRes); return true; } return false; }
/** * Sends requests to remote nodes. */ public void map() { mapTime = U.currentTimeMillis(); if (!mappings.isEmpty()) { for (GridDhtAtomicUpdateRequest<K, V> req : mappings.values()) { try { if (log.isDebugEnabled()) log.debug("Sending DHT atomic update request [nodeId=" + req.nodeId() + ", req=" + req + ']'); cctx.io().send(req.nodeId(), req); } catch (GridTopologyException ignored) { U.warn(log, "Failed to send update request to backup node because it left grid: " + req.nodeId()); mappings.remove(req.nodeId()); } catch (GridException e) { U.error(log, "Failed to send update request to backup node (did node leave the grid?): " + req.nodeId(), e); mappings.remove(req.nodeId()); } } } checkComplete(); // Send response right away if no ACKs from backup is required. // Backups will send ACKs anyway, future will be completed after all backups have replied. if (updateReq.writeSynchronizationMode() != FULL_SYNC) completionCb.apply(updateReq, updateRes); }