/** * Write ack received from node with given ID for given batch ID. * * @param nodeId Node ID. * @param batchId Batch ID. */ private void onWriteAck(UUID nodeId, long batchId) { if (!isDone()) { Set<Long> reqIds = pendingAcks.get(nodeId); assert reqIds != null : "Received acknowledgement message for not registered node [nodeId=" + nodeId + ", batchId=" + batchId + ']'; boolean rmv = reqIds.remove(batchId); assert rmv : "Received acknowledgement message for not registered batch [nodeId=" + nodeId + ", batchId=" + batchId + ']'; if (awaitingLast && checkCompleted()) onDone(true); } }
/** * Write ack received from node with given ID for given batch ID. * * @param nodeId Node ID. * @param batchId Batch ID. */ private void onWriteAck(UUID nodeId, long batchId) { if (!isDone()) { Set<Long> reqIds = pendingAcks.get(nodeId); assert reqIds != null : "Received acknowledgement message for not registered node [nodeId=" + nodeId + ", batchId=" + batchId + ']'; boolean rmv = reqIds.remove(batchId); assert rmv : "Received acknowledgement message for not registered batch [nodeId=" + nodeId + ", batchId=" + batchId + ']'; if (awaitingLast && checkCompleted()) onDone(true); } }
/** * Error occurred on node with given ID. * * @param nodeId Node ID. * @param e Caught exception. */ private void onError(UUID nodeId, GridException e) { Set<Long> reqIds = pendingAcks.get(nodeId); // If waiting for ack from this node. if (reqIds != null && !reqIds.isEmpty()) { if (e instanceof GridGgfsOutOfSpaceException) onDone(new GridException("Failed to write data (not enough space on node): " + nodeId, e)); else onDone(new GridException( "Failed to wait for write completion (write failed on node): " + nodeId, e)); } }
/** * Error occurred on node with given ID. * * @param nodeId Node ID. * @param e Caught exception. */ private void onError(UUID nodeId, GridException e) { Set<Long> reqIds = pendingAcks.get(nodeId); // If waiting for ack from this node. if (reqIds != null && !reqIds.isEmpty()) { if (e instanceof GridGgfsOutOfSpaceException) onDone(new GridException("Failed to write data (not enough space on node): " + nodeId, e)); else onDone(new GridException( "Failed to wait for write completion (write failed on node): " + nodeId, e)); } }
/** * @param e Error. */ private void onLocalError(GridException e) { if (e instanceof GridGgfsOutOfSpaceException) onDone(new GridException("Failed to write data (not enough space on node): " + ggfsCtx.kernalContext().localNodeId(), e)); else onDone(new GridException( "Failed to wait for write completion (write failed on node): " + ggfsCtx.kernalContext().localNodeId(), e)); }
/** * Marks this future as waiting last ack. */ private void markWaitingLastAck() { awaitingLast = true; if (log.isDebugEnabled()) log.debug("Marked write completion future as awaiting last ack: " + fileId); if (checkCompleted()) onDone(true); }
/** * Marks this future as waiting last ack. */ private void markWaitingLastAck() { awaitingLast = true; if (log.isDebugEnabled()) log.debug("Marked write completion future as awaiting last ack: " + fileId); if (checkCompleted()) onDone(true); }
/** * @param e Error. */ private void onLocalError(GridException e) { if (e instanceof GridGgfsOutOfSpaceException) onDone(new GridException("Failed to write data (not enough space on node): " + ggfsCtx.kernalContext().localNodeId(), e)); else onDone(new GridException( "Failed to wait for write completion (write failed on node): " + ggfsCtx.kernalContext().localNodeId(), e)); }