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


##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/GroupPageStoresMap.java:
##########
@@ -47,52 +50,156 @@ public GroupPageStoresMap(LongOperationAsyncExecutor 
longOperationAsyncExecutor)
     }
 
     /**
-     * Puts the page stores for the group.
+     * Puts the page store for the group partition.
+     *
+     * @param groupId Group ID.
+     * @param partitionId Partition ID.
+     * @param pageStore Page store.
+     * @return Previous page store.
+     */
+    public @Nullable T put(Integer groupId, Integer partitionId, T pageStore) {
+        return longOperationAsyncExecutor.afterAsyncCompletion(() -> {
+                    PartitionPageStore<T> previous = groupIdPageStores
+                            .computeIfAbsent(groupId, id -> new 
GroupPageStores<>(groupId))
+                            .partitionIdPageStore
+                            .put(partitionId, new 
PartitionPageStore<>(partitionId, pageStore));
+
+                    return previous == null ? null : previous.pageStore;
+                }
+        );
+    }
+
+    /**
+     * Removes the page store for the group partition.
      *
-     * @param grpId Group ID.
-     * @param pageStores Page stores.
-     * @return Previous page stores.
+     * @param groupId Group ID.
+     * @param partitionId Partition ID.
+     * @return Removed page store.
      */
-    public @Nullable List<T> put(Integer grpId, List<T> pageStores) {
-        return longOperationAsyncExecutor.afterAsyncCompletion(() -> 
groupPageStores.put(grpId, pageStores));
+    public @Nullable T remove(Integer groupId, Integer partitionId) {
+        AtomicReference<PartitionPageStore<T>> partitionPageStoreRef = new 
AtomicReference<>();
+
+        groupIdPageStores.compute(groupId, (id, groupPageStores) -> {

Review Comment:
   What can be used under the hood is not important, in this case the map.



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