/** * @param nodeId Node ID to send message to. * @param msg Message to send. * @throws IgniteCheckedException If send failed. */ private void sendWithRetries(UUID nodeId, IgfsCommunicationMessage msg) throws IgniteCheckedException { for (int i = 0; i < MESSAGE_SEND_RETRY_COUNT; i++) { try { igfsCtx.send(nodeId, topic, msg, IGFS_POOL); return; } catch (IgniteCheckedException e) { if (!igfsCtx.kernalContext().discovery().alive(nodeId)) throw new ClusterTopologyCheckedException("Failed to send message (node left the grid) " + "[nodeId=" + nodeId + ", msg=" + msg + ']'); if (i == MESSAGE_SEND_RETRY_COUNT - 1) throw e; U.sleep(MESSAGE_SEND_RETRY_INTERVAL); } } }
@Override public void apply(IgniteInternalFuture<?> fut) { IgniteCheckedException err = null; try { fut.get(); } catch (IgniteCheckedException e) { err = e; } try { // Send reply back to node. igfsCtx.send(nodeId, topic, new IgfsAckMessage(blocksMsg.fileId(), blocksMsg.id(), err), IGFS_POOL); } catch (IgniteCheckedException e) { U.warn(log, "Failed to send batch acknowledgement (did node leave the grid?) [nodeId=" + nodeId + ", fileId=" + blocksMsg.fileId() + ", batchId=" + blocksMsg.id() + ']', e); } } });
igfsCtx.send(nodeId, topic, msg, IGFS_POOL);
/** * @param nodeId Node ID to send message to. * @param msg Message to send. * @throws IgniteCheckedException If send failed. */ private void sendWithRetries(UUID nodeId, IgfsCommunicationMessage msg) throws IgniteCheckedException { for (int i = 0; i < MESSAGE_SEND_RETRY_COUNT; i++) { try { igfsCtx.send(nodeId, topic, msg, IGFS_POOL); return; } catch (IgniteCheckedException e) { if (!igfsCtx.kernalContext().discovery().alive(nodeId)) throw new ClusterTopologyCheckedException("Failed to send message (node left the grid) " + "[nodeId=" + nodeId + ", msg=" + msg + ']'); if (i == MESSAGE_SEND_RETRY_COUNT - 1) throw e; U.sleep(MESSAGE_SEND_RETRY_INTERVAL); } } }
@Override public void apply(IgniteInternalFuture<?> fut) { IgniteCheckedException err = null; try { fut.get(); } catch (IgniteCheckedException e) { err = e; } try { // Send reply back to node. igfsCtx.send(nodeId, topic, new IgfsAckMessage(blocksMsg.fileId(), blocksMsg.id(), err), IGFS_POOL); } catch (IgniteCheckedException e) { U.warn(log, "Failed to send batch acknowledgement (did node leave the grid?) [nodeId=" + nodeId + ", fileId=" + blocksMsg.fileId() + ", batchId=" + blocksMsg.id() + ']', e); } } });
igfsCtx.send(nodeId, topic, msg, IGFS_POOL);