You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/01/26 09:16:40 UTC
[GitHub] [flink] fapaul commented on a change in pull request #18412: [FLINK-25696][datastream] Introduce metadataConsumer to InitContext in Sink
fapaul commented on a change in pull request #18412:
URL: https://github.com/apache/flink/pull/18412#discussion_r792434481
##########
File path: flink-core/src/main/java/org/apache/flink/api/connector/sink/Sink.java
##########
@@ -170,6 +171,15 @@
* previous execution.
*/
OptionalLong getRestoredCheckpointId();
+
+ /**
+ * Returns a metadata consumer, the {@link SinkWriter} can publish metadata events of type
+ * {@link MetaT} to the consumer. The consumer can accept metadata events in an asynchronous
Review comment:
If you want to recommend not executing the metadata consumer as part of the mailbox you should make it clearer.
```suggestion
* <p> It is recommended to use a separate thread pool to publish the metadata because enqueuing a lot of these messages in the mailbox may lead to a performance decrease.
```
##########
File path: flink-core/src/main/java/org/apache/flink/api/connector/sink2/Sink.java
##########
@@ -105,5 +107,14 @@
* Provides a view on this context as a {@link SerializationSchema.InitializationContext}.
*/
SerializationSchema.InitializationContext asSerializationSchemaInitializationContext();
+
+ /**
+ * Returns a metadata consumer, the {@link SinkWriter} can publish metadata events of type
+ * {@link MetaT} to the consumer. The consumer can accept metadata events in an asynchronous
+ * thread, and the {@link Consumer#accept} method is executed very fast.
+ */
+ default <MetaT> Optional<Consumer<MetaT>> metadataConsumer() {
Review comment:
I'd mark this `@Experimental` to leave some room to change the threading model later if necessary.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org