mcvsubbu commented on code in PR #14883:
URL: https://github.com/apache/pinot/pull/14883#discussion_r1926374340


##########
pinot-spi/src/main/java/org/apache/pinot/spi/filesystem/LocalPinotFS.java:
##########
@@ -193,19 +200,78 @@ private static File toFile(URI uri) {
 
   private static void copy(File srcFile, File dstFile, boolean recursive)
       throws IOException {
-    if (dstFile.exists()) {
-      FileUtils.deleteQuietly(dstFile);
+    boolean oldFileExists = dstFile.exists(); // Automatically set 
oldFileExists if the old file exists
+
+    // Step 1: Calculate CRC of srcFile/directory
+    long srcCrc = calculateCrc(srcFile);
+    File backupFile = null;
+
+    if (oldFileExists) {
+      // Step 2: Rename destination file if it exists
+      backupFile = new File(dstFile.getAbsolutePath() + BACKUP);

Review Comment:
   Suggest adding a uuid or timestamp as well for the backup file name.



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