nizhikov commented on code in PR #10263:
URL: https://github.com/apache/ignite/pull/10263#discussion_r989874880


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java:
##########
@@ -1109,20 +1243,49 @@ public Set<UUID> cacheStartRequiredAliveNodes(@Nullable 
IgniteUuid restoreId) {
     /**
      * @return List of all known snapshots on the local node.
      */
-    public List<String> localSnapshotNames() {
+    public List<String> localSnapshotNames(@Nullable String snpPath) {
         if (cctx.kernalContext().clientNode())
             throw new UnsupportedOperationException("Client and daemon nodes 
can not perform this operation.");
 
         if (locSnpDir == null)
             return Collections.emptyList();
 
         synchronized (snpOpMux) {
-            return Arrays.stream(locSnpDir.listFiles(File::isDirectory))
+            File[] dirs = (snpPath == null ? locSnpDir : new 
File(snpPath)).listFiles(File::isDirectory);
+
+            if (dirs == null)
+                return Collections.emptyList();
+
+            return Arrays.stream(dirs)
                 .map(File::getName)
                 .collect(Collectors.toList());
         }
     }
 
+    /**
+     * @param snpName Full snapshot name.
+     * @param snpPath Snapshot path.
+     * @return Maximum existing incremental snapshot index.
+     */
+    private int maxLocalIncrementSnapshot(String snpName, @Nullable String 
snpPath) {

Review Comment:
   > actually it's already checked in createSnapshot
   
   Can you, please, clarify, what do you mean?
   
   > Let's resolve and validate snpPath before invoking the method
   
   Basically, all snapshot requests consists of two params - name, snpPath.
   So for every invocation of this method we must check snpPath for null.
   
   It seems move convinient to have method with two parameters.



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