Cyrill commented on code in PR #4056:
URL: https://github.com/apache/ignite-3/pull/4056#discussion_r1673734299
##########
modules/affinity/src/main/java/org/apache/ignite/internal/affinity/Assignments.java:
##########
@@ -53,32 +53,38 @@ public class Assignments implements Serializable {
*/
private final boolean force;
+ /**
+ * Version of Catalog that matches current assignments.
+ */
+ private final int catalogVersion;
+
/**
* Constructor.
*/
- private Assignments(Collection<Assignment> nodes, boolean force) {
+ private Assignments(Collection<Assignment> nodes, boolean force, int
catalogVersion) {
// A set of nodes must be a HashSet in order for serialization to
produce stable results,
// that could be compared as byte arrays.
this.nodes = nodes instanceof HashSet ? ((HashSet<Assignment>) nodes)
: new HashSet<>(nodes);
this.force = force;
+ this.catalogVersion = catalogVersion;
}
/**
* Creates a new instance.
*
* @param nodes Set of nodes.
*/
- public static Assignments of(Set<Assignment> nodes) {
- return new Assignments(nodes, false);
+ public static Assignments of(int catalogVersion, Set<Assignment> nodes) {
+ return new Assignments(nodes, false, catalogVersion);
}
/**
* Creates a new instance.
*
* @param nodes Array of nodes.
*/
- public static Assignments of(Assignment... nodes) {
- return new Assignments(Arrays.asList(nodes), false);
+ public static Assignments of(int catalogVersion, Assignment... nodes) {
Review Comment:
I put catalogVersion to the beginning for the consistency sake, to keep all
of() methods look similar
--
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]