nwangtw commented on a change in pull request #2910: make LocalFSStorage clean 
checkpoints before store
URL: https://github.com/apache/incubator-heron/pull/2910#discussion_r191931212
 
 

 ##########
 File path: 
heron/statefulstorages/src/java/org/apache/heron/statefulstorage/localfs/LocalFileSystemStorage.java
 ##########
 @@ -134,6 +146,23 @@ public void dispose(String topologyName, String 
oldestCheckpointPreserved,
     }
   }
 
+  private void cleanCheckpoints(String path, int remaining) throws 
StatefulStorageException {
+    if (FileUtils.isDirectoryExists(path) && FileUtils.hasChildren(path)) {
+      File[] children = new File(path).listFiles();
 
 Review comment:
   suggest to keep it consistent with dispose(), which uses:
   
   String[] names = new File(topologyCheckpointRoot).list();
   
   Sorting might be cheaper this way as well.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to