ibessonov commented on code in PR #1204:
URL: https://github.com/apache/ignite-3/pull/1204#discussion_r995466264


##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/ClusterState.java:
##########
@@ -32,76 +33,32 @@
  *     <li>Cluster tag, unique for a particular Ignite cluster.</li>
  * </ol>
  */
-public final class ClusterState implements Serializable {
-    private final Set<String> cmgNodes;
-
-    private final Set<String> msNodes;
-
-    private final IgniteProductVersion igniteVersion;
-
-    private final ClusterTag clusterTag;
-
+@Transferable(CmgMessageGroup.Commands.CLUSTER_STATE)
+public interface ClusterState extends NetworkMessage, Serializable {
     /**
-     * Creates a new cluster state.
-     *
-     * @param cmgNodes Node names that host the CMG.
-     * @param metaStorageNodes Node names that host the Meta Storage.
-     * @param igniteVersion Version of Ignite nodes that comprise this cluster.
-     * @param clusterTag Cluster tag.
+     * Returns node names that host the CMG.
      */
-    public ClusterState(
-            Collection<String> cmgNodes,
-            Collection<String> metaStorageNodes,
-            IgniteProductVersion igniteVersion,
-            ClusterTag clusterTag
-    ) {
-        this.cmgNodes = Set.copyOf(cmgNodes);
-        this.msNodes = Set.copyOf(metaStorageNodes);
-        this.igniteVersion = igniteVersion;
-        this.clusterTag = clusterTag;
-    }
-
-    public Set<String> cmgNodes() {
-        return cmgNodes;
-    }
-
-    public Set<String> metaStorageNodes() {
-        return msNodes;
-    }
-
-    public IgniteProductVersion igniteVersion() {
-        return igniteVersion;
-    }
+    Set<String> cmgNodes();
 
-    public ClusterTag clusterTag() {
-        return clusterTag;
-    }
+    /**
+     * Returns node names that host the Meta Storage.
+     */
+    Set<String> metaStorageNodes();
 
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) {
-            return true;
-        }
-        if (o == null || getClass() != o.getClass()) {
-            return false;
-        }
-        ClusterState state = (ClusterState) o;
-        return cmgNodes.equals(state.cmgNodes) && 
msNodes.equals(state.msNodes) && igniteVersion.equals(state.igniteVersion)
-                && clusterTag.equals(state.clusterTag);
-    }
+    /**
+     * Returns a version of Ignite nodes that comprise this cluster.
+     */
+    String version();

Review Comment:
   String is more convenient and only, like, 2-4 bytes more than byte[]. Not 
worth it



-- 
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]

Reply via email to