shishkovilja commented on code in PR #12531:
URL: https://github.com/apache/ignite/pull/12531#discussion_r2580926464
##########
modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java:
##########
@@ -56,462 +43,234 @@
*/
public class IgniteDiagnosticMessage implements Message {
/** */
- private static final int REQUEST_FLAG_MASK = 0x01;
-
- /** */
- private byte flags;
+ @Order(value = 0, method = "infoResponse")
+ private @Nullable String infoResp;
/** */
+ @Order(value = 1, method = "futureId")
private long futId;
- /** */
- private byte[] bytes;
+ /** Originator node id. */
+ @Order(2)
+ private UUID nodeId;
+
+ /** Infos to send to a remote node. */
+ @Order(3)
+ private final Set<DiagnosticBaseInfo> infos = new LinkedHashSet<>();
+
+ /** Local message related to remote info. */
+ private final Map<Object, List<String>> msgs = new LinkedHashMap<>();
/**
- * Required by {@link GridIoMessageFactory}.
+ * Default constructor required by {@link GridIoMessageFactory}.
*/
public IgniteDiagnosticMessage() {
// No-op.
}
/**
- * @param marsh Marshaller.
- * @param info Compound info.
- * @param futId Future ID.
- * @return Request message.
- * @throws IgniteCheckedException If failed.
+ * Creates a diagnostic info holder.
+ *
+ * @param nodeId Originator node ID.
*/
- public static IgniteDiagnosticMessage createRequest(Marshaller marsh,
- CompoundInfo info,
- long futId
- ) throws IgniteCheckedException {
- byte[] cBytes = U.marshal(marsh, info);
-
- IgniteDiagnosticMessage msg = new IgniteDiagnosticMessage();
-
- msg.futId = futId;
- msg.bytes = cBytes;
- msg.flags |= REQUEST_FLAG_MASK;
-
- return msg;
+ IgniteDiagnosticMessage(UUID nodeId) {
+ this.nodeId = nodeId;
}
/**
- * @param resBytes Marshalled result.
+ * Creates a diagnostic request.
+ *
* @param futId Future ID.
- * @return Response message.
- */
- public static IgniteDiagnosticMessage createResponse(byte[] resBytes, long
futId) {
- IgniteDiagnosticMessage msg = new IgniteDiagnosticMessage();
-
- msg.futId = futId;
- msg.bytes = resBytes;
-
- return msg;
- }
-
- /**
- * @param marsh Marshaller.
- * @return Unmarshalled payload.
- * @throws IgniteCheckedException If failed.
+ * @param nodeId Node ID.
+ * @param infos Diagnostic infos.
*/
- @Nullable public <T> T unmarshal(Marshaller marsh)
- throws IgniteCheckedException {
- if (bytes == null)
- return null;
+ public IgniteDiagnosticMessage(long futId, UUID nodeId,
Collection<DiagnosticBaseInfo> infos) {
+ this(nodeId);
- return U.unmarshal(marsh, bytes, null);
+ this.futId = futId;
+ this.infos.addAll(infos);
Review Comment:
Do we need to copy original collection?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]