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


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryTableStorage.java:
##########
@@ -374,6 +379,53 @@ private IndexMetaTree createIndexMetaTree(
         }
     }
 
+    /**
+     * Returns new {@link GarbageCollectionTree} instance for partition.
+     *
+     * @param tableView Table configuration.
+     * @param partitionId Partition ID.
+     * @param reuseList Reuse list.
+     * @param pageMemory Persistent page memory instance.
+     * @param meta Partition metadata.
+     * @throws StorageException If failed.
+     */
+    private GarbageCollectionTree createGarbageCollectionTree(
+            TableView tableView,
+            int partitionId,
+            ReuseList reuseList,
+            PersistentPageMemory pageMemory,
+            PartitionMeta meta
+    ) {
+        try {
+            boolean initNew = false;
+
+            if (meta.garbageCollectionTreeMetaPageId() == 0) {
+                long rootPageId = pageMemory.allocatePage(tableView.tableId(), 
partitionId, FLAG_AUX);
+
+                meta.garbageCollectionTreeMetaPageId(lastCheckpointId(), 
rootPageId);
+
+                initNew = true;
+            }
+
+            return new GarbageCollectionTree(
+                    tableView.tableId(),
+                    tableView.name(),
+                    partitionId,
+                    dataRegion.pageMemory(),
+                    PageLockListenerNoOp.INSTANCE,
+                    new AtomicLong(),
+                    meta.garbageCollectionTreeMetaPageId(),
+                    reuseList,
+                    initNew
+            );
+        } catch (IgniteInternalCheckedException e) {

Review Comment:
   I'm not talking only about this particular case. I can see this pattern 
everywhere: we catch an IgniteCheckedException and wrap it into a 
StorageException. What's the point? Can we throw a StorageException directly? 
And I'm not asking to fix it in this PR, I'm asking if we should create a 
ticket and fix that later



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