pnowojski commented on a change in pull request #6989: [FLINK-10455][Kafka Tx] 
Close transactional producers in case of failure and termination
URL: https://github.com/apache/flink/pull/6989#discussion_r230404337
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/TwoPhaseCommitSinkFunction.java
 ##########
 @@ -150,6 +154,13 @@ protected TXN currentTransaction() {
                return currentTransactionHolder == null ? null : 
currentTransactionHolder.handle;
        }
 
+       @Nonnull
+       protected Map<Long, TXN> pendingTransactions() {
+               return pendingCommitTransactions.entrySet().stream()
+                       .map(e -> new AbstractMap.SimpleEntry<>(e.getKey(), 
e.getValue().handle))
+                       .collect(Collectors.toMap(Map.Entry::getKey, 
Map.Entry::getValue));
 
 Review comment:
   why do you `collect` and not just return a stream?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to