timoninmaxim commented on code in PR #12119: URL: https://github.com/apache/ignite/pull/12119#discussion_r2128600971
########## modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java: ########## @@ -219,52 +205,55 @@ public boolean request() { // No-op. } - /** - * - */ - public abstract static class DiagnosticBaseClosure implements IgniteBiInClosure<StringBuilder, GridKernalContext> { - /** - * @return Key to group similar messages. - */ + /** */ + public abstract static class DiagnosticBaseInfo implements Externalizable { + /** @return Key to group similar messages. */ public Object mergeKey() { Review Comment: Let's make this method abstract. ########## modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java: ########## @@ -298,49 +287,49 @@ public static final class TxEntriesInfoClosure extends DiagnosticBaseClosure { } /** {@inheritDoc} */ - @Override public void merge(DiagnosticBaseClosure other) { - TxEntriesInfoClosure other0 = (TxEntriesInfoClosure)other; + @Override public void merge(DiagnosticBaseInfo other) { + TxEntriesInfo other0 = (TxEntriesInfo)other; assert other0 != null && cacheId == other0.cacheId : other; this.keys.addAll(other0.keys); } - /** - * @param out Output stream. - * @throws IOException If failed. - */ - private void writeObject(java.io.ObjectOutputStream out) - throws IOException { - /* - Transform to List, otherwise Set unmarshalling fails since need - call KeyCacheObject.finishUnmarshal before adding in Set. - */ + /** {@inheritDoc} */ + @Override public void writeExternal(ObjectOutput out) throws IOException { this.keys = new ArrayList<>(keys); - out.defaultWriteObject(); + out.writeObject(this.keys); Review Comment: U.writeCollection ########## modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java: ########## @@ -42,18 +43,15 @@ import org.apache.ignite.internal.util.typedef.T3; import org.apache.ignite.internal.util.typedef.internal.S; import org.apache.ignite.internal.util.typedef.internal.U; -import org.apache.ignite.lang.IgniteBiInClosure; -import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.marshaller.Marshaller; import org.apache.ignite.plugin.extensions.communication.Message; import org.apache.ignite.plugin.extensions.communication.MessageReader; import org.apache.ignite.plugin.extensions.communication.MessageWriter; +import org.apache.ignite.spi.communication.CommunicationSpi; import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; import org.jetbrains.annotations.Nullable; -/** Review Comment: Please, revert meaningless changes in javadocs ########## modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticPrepareContext.java: ########## @@ -86,49 +82,42 @@ public void txKeyInfo(UUID nodeId, int cacheId, Collection<KeyCacheObject> keys, * @param msg Initial message. */ public void remoteTxInfo(UUID nodeId, GridCacheVersion dhtVer, GridCacheVersion nearVer, String msg) { - closure(nodeId).add(msg, new TxInfoClosure(dhtVer, nearVer)); + compoundInfo(nodeId).add(msg, new TxInfo(dhtVer, nearVer)); } /** * @param nodeId Remote node ID. * @param msg Initial message. */ public void basicInfo(UUID nodeId, String msg) { - closure(nodeId).add(msg, null); + compoundInfo(nodeId).add(msg, null); } /** * @param nodeId Remote node ID. - * @return Compound closure + * @return Compound info. */ - private CompoundInfoClosure closure(UUID nodeId) { - CompoundInfoClosure cl = cls.get(nodeId); + private CompoundInfo compoundInfo(UUID nodeId) { + CompoundInfo i = info.get(nodeId); Review Comment: Let's use more meaningful variable names. `i` is usually used for var in iteration loops, then use it a little bit misleading -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org