JingGe commented on a change in pull request #18666:
URL: https://github.com/apache/flink/pull/18666#discussion_r802876373



##########
File path: 
flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/connector/elasticsearch/sink/ElasticsearchWriter.java
##########
@@ -125,15 +124,14 @@ public void write(IN element, Context context) throws 
IOException, InterruptedEx
     }
 
     @Override
-    public List<Void> prepareCommit(boolean flush) throws IOException, 
InterruptedException {
+    public void flush(boolean endOfInput) throws IOException, 
InterruptedException {
         checkpointInProgress = true;
-        while (pendingActions != 0 && (flushOnCheckpoint || flush)) {
+        while (pendingActions != 0 && flushOnCheckpoint) {

Review comment:
       Afaik `(flushOnCheckpoint || endOfInput)` means to, like the javadoc 
said, trigger the flush on checkpoint "or" at end of input, which means even if 
with false `flushOnCheckpoint`, the flush will also be triggered at the end of 
input. Ingoring the `endOfInput` seems changed the behaviour of that method.




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