pnowojski commented on a change in pull request #9287: [FLINK-13498][kafka] 
abort transactions in parallel
URL: https://github.com/apache/flink/pull/9287#discussion_r309068393
 
 

 ##########
 File path: 
flink-connectors/flink-connector-kafka-0.11/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer011.java
 ##########
 @@ -906,11 +907,33 @@ private void 
resetAvailableTransactionalIdsPool(Collection<String> transactional
        // ----------------------------------- Utilities 
--------------------------
 
        private void abortTransactions(Set<String> transactionalIds) {
-               for (String transactionalId : transactionalIds) {
-                       try (FlinkKafkaProducer<byte[], byte[]> kafkaProducer =
-                                       
initTransactionalProducer(transactionalId, false)) {
-                               // it suffice to call initTransactions - this 
will abort any lingering transactions
-                               kafkaProducer.initTransactions();
+               // shortcut for non-exactly-once producers
+               if (transactionalIds.isEmpty()) {
+                       return;
+               }
+
+               ForkJoinPool forkJoinPool = null;
 
 Review comment:
   I think you can change this line to
   ```
   ForkJoinPool forkJoinPool = new ForkJoinPool(kafkaProducersPoolSize);
   ```
   thus avoiding null handling.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to