sashapolo commented on code in PR #795:
URL: https://github.com/apache/ignite-3/pull/795#discussion_r877996768
##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/LocalStateStorage.java:
##########
@@ -30,7 +30,26 @@
* <p>This state has nothing to do with local Raft state and is only used on
node startup, when Raft groups have not yet been started.
*/
class LocalStateStorage {
- private static final ByteArray CMG_NODES_VAULT_KEY =
ByteArray.fromString("cmg_nodes");
+ private static final ByteArray CMG_STATE_VAULT_KEY =
ByteArray.fromString("cmg_state");
+
+ static class LocalState implements Serializable {
+ private final Set<String> cmgNodeNames;
+
+ private final ClusterTag clusterTag;
+
+ LocalState(Set<String> cmgNodeNames, ClusterTag clusterTag) {
+ this.cmgNodeNames = cmgNodeNames;
Review Comment:
AFAIK Ignite coding policies despises defensive copies. I'm ok with making
defensive copies in public API classes, but I don't think it's really needed in
internal classes
##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/LocalStateStorage.java:
##########
@@ -30,7 +30,26 @@
* <p>This state has nothing to do with local Raft state and is only used on
node startup, when Raft groups have not yet been started.
*/
class LocalStateStorage {
- private static final ByteArray CMG_NODES_VAULT_KEY =
ByteArray.fromString("cmg_nodes");
+ private static final ByteArray CMG_STATE_VAULT_KEY =
ByteArray.fromString("cmg_state");
+
+ static class LocalState implements Serializable {
+ private final Set<String> cmgNodeNames;
+
+ private final ClusterTag clusterTag;
+
+ LocalState(Set<String> cmgNodeNames, ClusterTag clusterTag) {
+ this.cmgNodeNames = cmgNodeNames;
Review Comment:
AFAIK Ignite coding policies despises defensive copies. I'm ok with making
defensive copies in public API classes, but I don't think they are really
needed in internal classes
--
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]