JingsongLi commented on a change in pull request #23:
URL: https://github.com/apache/flink-table-store/pull/23#discussion_r812784560
##########
File path:
flink-table-store-connector/src/main/java/org/apache/flink/table/store/connector/sink/global/GlobalCommitterOperator.java
##########
@@ -103,18 +115,20 @@ public void snapshotState(StateSnapshotContext context)
throws Exception {
if (committables.size() > 0) {
committablesPerCheckpoint.put(
context.getCheckpointId(),
- globalCommitter.combine(context.getCheckpointId(),
committables));
+ committer.combine(context.getCheckpointId(),
committables));
}
streamingCommitterState.update(new
ArrayList<>(committablesPerCheckpoint.values()));
}
@Override
public void endInput() throws Exception {
- List<CommT> allCommittables = pollCommittables();
- if (!allCommittables.isEmpty()) {
- globalCommitter.commit(
- Collections.singletonList(
- globalCommitter.combine(Long.MAX_VALUE,
allCommittables)));
+ if (isBounded) {
+ List<CommT> allCommittables = pollCommittables();
+ if (!allCommittables.isEmpty()) {
+ committer.commit(
+ Collections.singletonList(
+ committer.combine(Long.MAX_VALUE,
allCommittables)));
+ }
Review comment:
You can see the document in `BoundedOneInput`.
> It is not safe to use this method to commit any transactions or other side
effects! You can use this method to flush any buffered data that can later on
be committed e.g. in a `{@link StreamOperator#notifyCheckpointComplete(long)}`.
--
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]