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