lightzhao commented on code in PR #3906:
URL:
https://github.com/apache/incubator-seatunnel/pull/3906#discussion_r1065588415
##########
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:
complete modify.
##########
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);
+ }
+ }
+ } catch (Exception e){
+ log.error("delete no commit file failed", e);
Review Comment:
complete modify.
--
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]