/** * @param nodeId Target node ID. * @param c Message closure. * @return Message future. */ private IgniteInternalFuture<IgniteDiagnosticInfo> sendDiagnosticMessage(UUID nodeId, IgniteClosure<GridKernalContext, IgniteDiagnosticInfo> c) { try { IgniteDiagnosticMessage msg = IgniteDiagnosticMessage.createRequest(marsh, c, diagFutId.getAndIncrement()); InternalDiagnosticFuture fut = new InternalDiagnosticFuture(nodeId, msg.futureId()); diagnosticFuturesMap().put(msg.futureId(), fut); ctx.io().sendToGridTopic(nodeId, TOPIC_INTERNAL_DIAGNOSTIC, msg, GridIoPolicy.SYSTEM_POOL); return fut; } catch (Exception e) { U.error(diagnosticLog, "Failed to send diagnostic message: " + e); return new GridFinishedFuture<>(new IgniteDiagnosticInfo("Failed to send diagnostic message: " + e)); } }
/** * @param nodeId Target node ID. * @param c Message closure. * @return Message future. */ private IgniteInternalFuture<IgniteDiagnosticInfo> sendDiagnosticMessage(UUID nodeId, IgniteClosure<GridKernalContext, IgniteDiagnosticInfo> c) { try { IgniteDiagnosticMessage msg = IgniteDiagnosticMessage.createRequest(marsh, c, diagFutId.getAndIncrement()); InternalDiagnosticFuture fut = new InternalDiagnosticFuture(nodeId, msg.futureId()); diagnosticFuturesMap().put(msg.futureId(), fut); ctx.io().sendToGridTopic(nodeId, TOPIC_INTERNAL_DIAGNOSTIC, msg, GridIoPolicy.SYSTEM_POOL); return fut; } catch (Exception e) { U.error(diagnosticLog, "Failed to send diagnostic message: " + e); return new GridFinishedFuture<>(new IgniteDiagnosticInfo("Failed to send diagnostic message: " + e)); } }