ibessonov commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1073651359


##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryTableStorage.java:
##########
@@ -405,42 +373,148 @@ private IndexMetaTree createIndexMetaTree(
     }
 
     @Override
-    public CompletableFuture<Void> startRebalancePartition(int partitionId) {
-        // TODO: IGNITE-18029 Implement
-        throw new UnsupportedOperationException();
-    }
+    CompletableFuture<Void> 
destroyMvPartitionStorage(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
+        // It is enough for us to close the partition storage and its indexes 
(do not destroy). Prepare the data region, checkpointer, and
+        // compactor to remove the partition, and then simply delete the 
partition file and its delta files.
+        mvPartitionStorage.close();
 
-    @Override
-    public CompletableFuture<Void> abortRebalancePartition(int partitionId) {
-        // TODO: IGNITE-18029 Implement
-        throw new UnsupportedOperationException();
+        return 
destroyPartitionPhysically(createGroupPartitionId(mvPartitionStorage.partitionId()));
     }
 
     @Override
-    public CompletableFuture<Void> finishRebalancePartition(int partitionId, 
long lastAppliedIndex, long lastAppliedTerm) {
-        // TODO: IGNITE-18029 Implement
-        throw new UnsupportedOperationException();
-    }
+    CompletableFuture<Void> 
clearStorageAndUpdateDataStructures(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {

Review Comment:
   I meant the method of the base class



##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryTableStorage.java:
##########
@@ -405,42 +373,148 @@ private IndexMetaTree createIndexMetaTree(
     }
 
     @Override
-    public CompletableFuture<Void> startRebalancePartition(int partitionId) {
-        // TODO: IGNITE-18029 Implement
-        throw new UnsupportedOperationException();
-    }
+    CompletableFuture<Void> 
destroyMvPartitionStorage(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
+        // It is enough for us to close the partition storage and its indexes 
(do not destroy). Prepare the data region, checkpointer, and
+        // compactor to remove the partition, and then simply delete the 
partition file and its delta files.
+        mvPartitionStorage.close();
 
-    @Override
-    public CompletableFuture<Void> abortRebalancePartition(int partitionId) {
-        // TODO: IGNITE-18029 Implement
-        throw new UnsupportedOperationException();
+        return 
destroyPartitionPhysically(createGroupPartitionId(mvPartitionStorage.partitionId()));
     }
 
     @Override
-    public CompletableFuture<Void> finishRebalancePartition(int partitionId, 
long lastAppliedIndex, long lastAppliedTerm) {
-        // TODO: IGNITE-18029 Implement
-        throw new UnsupportedOperationException();
-    }
+    CompletableFuture<Void> 
clearStorageAndUpdateDataStructures(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
+        GroupPartitionId groupPartitionId = 
createGroupPartitionId(mvPartitionStorage.partitionId());
 
-    @Override
-    CompletableFuture<Void> 
destroyMvPartitionStorage(AbstractPageMemoryMvPartitionStorage 
mvPartitionStorage) {
-        int partitionId = mvPartitionStorage.partitionId();
+        return destroyPartitionPhysically(groupPartitionId).thenAccept(unused 
-> {
+            TableView tableView = tableConfig.value();
 
-        // It is enough for us to close the partition storage and its indexes 
(do not destroy). Prepare the data region, checkpointer, and
-        // compactor to remove the partition, and then simply delete the 
partition file and its delta files.
+            PersistentPageMemory pageMemory = dataRegion.pageMemory();
 
-        mvPartitionStorage.close();
+            int partitionId = groupPartitionId.getPartitionId();
+
+            PartitionMeta meta = getOrCreatePartitionMeta(groupPartitionId, 
ensurePartitionFilePageStore(tableView, groupPartitionId));

Review Comment:
   Extract method?



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