tkalkirill commented on code in PR #791:
URL: https://github.com/apache/ignite-3/pull/791#discussion_r860937451


##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PageMemoryImpl.java:
##########
@@ -149,6 +171,7 @@ public class PageMemoryImpl implements PageMemoryEx {
     private final DirectMemoryProvider directMemoryProvider;
 
     /** Segments array. */
+    @Nullable

Review Comment:
   While the page memory has not started, this may be **null**, added a comment.



##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PageMemoryImpl.java:
##########
@@ -1598,4 +1727,327 @@ public interface PageChangeTracker {
          */
         void apply(long page, FullPageId fullPageId, PageMemoryEx 
pageMemoryEx);
     }
+
+    /**
+     * Heuristic method which allows a thread to check if it is safe to start 
memory structure modifications in regard with checkpointing.
+     * May return false-negative result during or after partition eviction.
+     *
+     * @return {@code False} if there are too many dirty pages and a thread 
should wait for a checkpoint to begin.
+     */
+    public boolean safeToUpdate() {
+        if (segments != null) {
+            return safeToUpdate.get();
+        }
+
+        return true;
+    }
+
+    /**
+     * Returns number of pages used in checkpoint buffer.
+     */
+    public int usedCheckpointBufferPages() {
+        PagePool checkpointPool = this.checkpointPool;

Review Comment:
   While the page memory has not started, this may be **null**, added a comment.



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