TyrantLucifer commented on code in PR #3717:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3717#discussion_r1047034539


##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/writer/AbstractWriteStrategy.java:
##########
@@ -289,22 +276,27 @@ public List<String> 
getTransactionIdFromStates(List<FileSinkState> fileStates) {
     @Override
     public List<FileSinkState> snapshotState(long checkpointId) {
         Map<String, List<String>> commitMap = 
this.partitionDirAndValuesMap.entrySet().stream()
-                .collect(Collectors.toMap(Map.Entry::getKey, e -> new 
ArrayList<>(e.getValue())));
+            .collect(Collectors.toMap(Map.Entry::getKey, e -> new 
ArrayList<>(e.getValue())));
         ArrayList<FileSinkState> fileState = Lists.newArrayList(new 
FileSinkState(this.transactionId,
-                this.checkpointId, new HashMap<>(this.needMoveFiles),
-                commitMap, this.getTransactionDir(transactionId)));
+            this.uuidPrefix, this.checkpointId, new 
HashMap<>(this.needMoveFiles),
+            commitMap, this.getTransactionDir(transactionId)));
         this.beingWrittenFile.clear();
         this.beginTransaction(checkpointId + 1);
         return fileState;
     }
 
     /**
      * using transaction id generate transaction directory
+     *
      * @param transactionId transaction id
      * @return transaction directory
      */
     private String getTransactionDir(@NonNull String transactionId) {
-        String[] strings = new String[]{textFileSinkConfig.getTmpPath(), 
BaseSinkConfig.SEATUNNEL, jobId, transactionId};
+        return getTransactionDirPrefix(textFileSinkConfig.getTmpPath(), jobId, 
uuidPrefix) + File.separator + transactionId;

Review Comment:
   ```suggestion
           String transactionDirectoryPrefix = 
getTransactionDirPrefix(textFileSinkConfig.getTmpPath(), jobId, uuidPrefix);
           return String.join(File.separator, new 
String[]{transactionDirectoryPrefix, transactionId})
   ```



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

Reply via email to