tkalkirill commented on code in PR #920:
URL: https://github.com/apache/ignite-3/pull/920#discussion_r923169668
##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointDirtyPages.java:
##########
@@ -108,33 +100,54 @@ public
IgniteConcurrentMultiPairQueue<PersistentPageMemory, GroupPartitionId> to
* @param partId Partition ID.
*/
public @Nullable CheckpointDirtyPagesView findView(int grpId, int partId) {
- if (dirtyPages.isEmpty()) {
- return null;
+ for (int i = 0; i < dirtyPages.size(); i++) {
+ CheckpointDirtyPagesView view = findView(i, grpId, partId);
+
+ if (view != null) {
+ return view;
+ }
}
- FullPageId startPageId = new FullPageId(pageId(partId, (byte) 0, 0),
grpId);
- FullPageId endPageId = new FullPageId(pageId(partId + 1, (byte) 0, 0),
grpId);
+ return null;
+ }
+ /**
+ * Looks for dirty page IDs views for a specific group and partition.
+ *
+ * @param pageMemory Page memory.
+ * @param grpId Group ID.
+ * @param partId Partition ID.
+ */
+ public @Nullable CheckpointDirtyPagesView findView(PersistentPageMemory
pageMemory, int grpId, int partId) {
for (int i = 0; i < dirtyPages.size(); i++) {
- FullPageId[] pageIds = dirtyPages.get(i).dirtyPages.pageIds;
+ if (dirtyPages.get(i).pageMemory == pageMemory) {
+ return findView(i, grpId, partId);
+ }
+ }
- int fromIndex = binarySearch(pageIds, startPageId,
DIRTY_PAGE_COMPARATOR);
+ return null;
Review Comment:
Technically possible, I can add a check.
--
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]