You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2023/01/10 09:54:44 UTC

[GitHub] [incubator-seatunnel] FlechazoW commented on a diff in pull request #3906: [Improve][connector-v2][HdfsFileSink]Delete temporary files not caused by checkpoint.

FlechazoW commented on code in PR #3906:
URL: https://github.com/apache/incubator-seatunnel/pull/3906#discussion_r1065564394


##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/writer/AbstractWriteStrategy.java:
##########
@@ -328,6 +329,24 @@ public String getTargetLocation(@NonNull String seaTunnelFilePath) {
         return tmpPath.replaceAll(BaseSinkConfig.NON_PARTITION + Matcher.quoteReplacement(File.separator), "");
     }
 
+    /**
+     * Delete temporary files not caused by checkpoint.
+     * @param tmpFilePaths temporary files.
+     * @return void
+     */
+    public void deleteTmpFileWithNoCheckPoint(Set<String> tmpFilePaths){
+        try {
+            if (tmpFilePaths != null && tmpFilePaths.size() > 0) {
+                for (String filePath : tmpFilePaths){
+                    fileSystemUtils.deleteFile(filePath);
+                    log.info("delete no commit file:{}", filePath);

Review Comment:
   What's the meaning of 'no commit file'? Why not use the 'temporary file ' or 'uncommitted file'?



-- 
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-unsubscribe@seatunnel.apache.org

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