tkalkirill commented on code in PR #920:
URL: https://github.com/apache/ignite-3/pull/920#discussion_r923118797
##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PartitionMeta.java:
##########
@@ -17,33 +17,54 @@
package org.apache.ignite.internal.pagememory.persistence;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import org.apache.ignite.internal.tostring.S;
+import org.jetbrains.annotations.Nullable;
/**
* Partition meta information.
*/
public class PartitionMeta {
+ private static final AtomicIntegerFieldUpdater<PartitionMeta>
PAGE_COUNT_UPDATER = AtomicIntegerFieldUpdater.newUpdater(
+ PartitionMeta.class,
+ "pageCount"
+ );
+
+ private static final VarHandle META_SNAPSHOT_VH;
+
+ static {
+ try {
+ META_SNAPSHOT_VH =
MethodHandles.lookup().findVarHandle(PartitionMeta.class, "metaSnapshot",
PartitionMetaSnapshot.class);
+ } catch (ReflectiveOperationException e) {
+ throw new ExceptionInInitializerError(e);
+ }
+ }
+
private volatile long treeRootPageId;
private volatile long reuseListRootPageId;
private volatile int pageCount;
- private final boolean created;
+ private volatile PartitionMetaSnapshot metaSnapshot;
/**
* Constructor.
*
+ * @param checkpointId Checkpoint ID.
* @param treeRootPageId Tree root page ID.
* @param reuseListRootPageId Reuse list root page ID.
* @param pageCount Count of pages in the partition.
- * @param created {@code True} if the partition meta was created, {@code
false} if it was read from a partition file.
*/
- public PartitionMeta(long treeRootPageId, long reuseListRootPageId, int
pageCount, boolean created) {
+ public PartitionMeta(@Nullable UUID checkpointId, long treeRootPageId,
long reuseListRootPageId, int pageCount) {
Review Comment:
It will be **null** until the first breakpoint occurs. Do you think this can
be ignored?
--
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]