sashapolo commented on code in PR #5443:
URL: https://github.com/apache/ignite-3/pull/5443#discussion_r2005161875


##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/raft/PartitionSnapshotInfo.java:
##########
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.partition.replicator.raft;
+
+import java.util.Arrays;
+import java.util.Objects;
+import java.util.Set;
+import org.apache.ignite.internal.storage.lease.LeaseInfo;
+import org.apache.ignite.internal.tostring.S;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Class containing information about the last performed Raft snapshot.
+ */
+public class PartitionSnapshotInfo {
+    private final long lastAppliedIndex;
+
+    private final long lastAppliedTerm;
+
+    @Nullable
+    private final LeaseInfo leaseInfo;
+
+    private final byte[] configuration;
+
+    private final Set<Integer> tableIds;
+
+    /**
+     * Constructor.
+     *
+     * @param lastAppliedIndex Applied index at the moment when the snapshot 
was taken.
+     * @param lastAppliedTerm Applied term at the moment when the snapshot was 
taken.
+     * @param leaseInfo Lease information.
+     * @param configuration Raft group configuration.
+     * @param tableIds IDs of tables that were part of the Raft group when the 
snapshot was taken.
+     */
+    public PartitionSnapshotInfo(
+            long lastAppliedIndex,
+            long lastAppliedTerm,
+            @Nullable LeaseInfo leaseInfo,
+            byte[] configuration,
+            Set<Integer> tableIds
+    ) {
+        this.lastAppliedIndex = lastAppliedIndex;
+        this.lastAppliedTerm = lastAppliedTerm;
+        this.leaseInfo = leaseInfo;
+        this.configuration = configuration;
+        this.tableIds = tableIds;

Review Comment:
   you mean, by creating a defensive copy? Ok



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

Reply via email to