AHeise commented on a change in pull request #16701:
URL: https://github.com/apache/flink/pull/16701#discussion_r682658272
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/sink/BatchCommitterHandler.java
##########
@@ -33,44 +30,52 @@
* Runtime {@link org.apache.flink.streaming.api.operators.StreamOperator} for
executing {@link
* Committer} in the batch execution mode.
*
- * @param <CommT> The committable type of the {@link Committer}.
+ * @param <InputT> The committable type of the {@link Committer}.
*/
-final class BatchCommitterOperator<CommT> extends AbstractStreamOperator<CommT>
- implements OneInputStreamOperator<CommT, CommT>, BoundedOneInput {
+final class BatchCommitterHandler<InputT, OutputT>
+ extends AbstractCommitterHandler<InputT, OutputT> {
/** Responsible for committing the committable to the external system. */
- private final Committer<CommT> committer;
+ private final Committer<InputT> committer;
- /** Record all the committables until the end of the input. */
- private final List<CommT> allCommittables;
+ /**
+ * The committer that is chained to this committer. It's either {@link
+ * GlobalBatchCommitterHandler} or {@link NoopCommitterHandler}.
Review comment:
Here is some reference https://en.wikipedia.org/wiki/Null_object_pattern
TL;DR `null` is an external construct in OOP.
Also don't worry about performance here: First, we have a singleton pattern
as an enum that's very efficient. Second, we are not on the hot path.
--
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]