Vladsz83 commented on code in PR #13577:
URL: https://github.com/apache/ignite/pull/13577#discussion_r4065193301


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java:
##########
@@ -701,46 +708,90 @@ public IgniteSnapshotManager(GridKernalContext ctx) {
     /**
      * @param snpDir Snapshot dir.
      */
-    public void deleteSnapshot(File snpDir) {
+    public void deleteLocalSnapshot(File snpDir) {
         if (!snpDir.exists())
             return;
 
         if (!snpDir.isDirectory())
             return;
 
-        deleteSnapshot(new SnapshotFileTree(
+        var sft = new SnapshotFileTree(
             cctx.kernalContext(),
             snpDir.getName(),
             snpDir.getParent(),
             ft.folderName(),
-            pdsSettings.consistentId().toString()));
+            pdsSettings.consistentId().toString()
+        );
+
+        deleteLocalSnapshot(sft);
     }
 
-    /** */
-    public void deleteSnapshot(SnapshotFileTree sft) {
-        try {
-            U.delete(sft.binaryMeta());
-            sft.allStorages().forEach(U::delete);
-            U.delete(sft.meta());
+    /**
+     * Deletes local shapshot data.
+     *
+     * @param sft Snapshot file tree
+     */
+    public boolean deleteLocalSnapshot(SnapshotFileTree sft) {
+        return deleteLocalSnapshot(sft, null);
+    }
+
+    /**
+     * Deletes local shapshot data.
+     *
+     * @param sft Snapshot file tree
+     * @param existsFlag Flag to set {@code true} if any snapshot file or 
directory was found (existed). If {@code null}, ignored.
+     * @return {@code True}, if data is found and completely deleted or if no 
data found;
+     *         {@code False}, if data is found but might not be deleted 
completely or if was canceled.
+     */
+    public boolean deleteLocalSnapshot(SnapshotFileTree sft, @Nullable 
AtomicBoolean existsFlag) {

Review Comment:
   Reused to add the goal - delete a snp. Touched just to reach the goal.



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