jadami10 commented on a change in pull request #7961:
URL: https://github.com/apache/pinot/pull/7961#discussion_r780012852



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java
##########
@@ -102,6 +103,10 @@ public void init(TableDataManagerConfig 
tableDataManagerConfig, String instanceI
     if (!_indexDir.exists()) {
       Preconditions.checkState(_indexDir.mkdirs());
     }
+    _resourceTmpDir = new File(_indexDir, "tmp");

Review comment:
       added a comment

##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java
##########
@@ -102,6 +103,12 @@ public void init(TableDataManagerConfig 
tableDataManagerConfig, String instanceI
     if (!_indexDir.exists()) {
       Preconditions.checkState(_indexDir.mkdirs());
     }
+    _resourceTmpDir = new File(_indexDir, "tmp");
+    // Delete and recreate the tmp directory if it exists as it may contain 
old files from previous runs.
+    _resourceTmpDir.delete();

Review comment:
       good point, done. the exists check really shouldn't be needed here, but 
I figure it can't hurt since we're using `Preconditions` afterwards




-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to