You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/04/06 15:48:51 UTC

[GitHub] [ignite] alex-plekhanov commented on a change in pull request #6554: IGNITE-11073: Backup page store manager, initial

alex-plekhanov commented on a change in pull request #6554: IGNITE-11073: Backup page store manager, initial
URL: https://github.com/apache/ignite/pull/6554#discussion_r404171461
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java
 ##########
 @@ -578,18 +584,57 @@ private void finishRecover(RemoteSnapshotFuture snpTrans, GroupPartitionId grpPa
     }
 
     /**
-     * @return Relative configured path of presistence data storage directory for the local node.
-     * Example: {@code snapshotWorkDir/db/IgniteNodeName0}
+     * Concurrently traverse the snapshot directory for given local node folder name and
+     * delete recursively all files from it if exist.
+     *
+     * @param snpDir Snapshot dire
+     * @param folderName Local node folder name (see U.maskForFileName with consistent id).
      */
-    public static String relativeNodePath(PdsFolderSettings pcfg) {
-        return Paths.get(DB_DEFAULT_FOLDER, pcfg.folderName()).toString();
+    public static void deleteSnapshot(File snpDir, String folderName) {
+        if (!snpDir.exists())
+            return;
+
+        assert snpDir.isDirectory() : snpDir;
+
+        try {
+            List<Path> dirs = new ArrayList<>();
+
+            Files.walkFileTree(snpDir.toPath(), new SimpleFileVisitor<Path>() {
 
 Review comment:
   Why can't we use just `U.delete()`?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services