wanglijie95 commented on code in PR #22840:
URL: https://github.com/apache/flink/pull/22840#discussion_r1257432832
##########
flink-core/src/main/java/org/apache/flink/api/connector/sink2/Sink.java:
##########
@@ -116,6 +118,18 @@ interface InitContext {
*/
SerializationSchema.InitializationContext
asSerializationSchemaInitializationContext();
+ /** Returns whether object reuse has been enabled or disabled. */
+ boolean isObjectReuseEnabled();
+
+ /** Creates a serializer for the Input type. */
Review Comment:
```suggestion
/** Creates a serializer for the type of sink's input. */
```
##########
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/sink/SinkWriterOperator.java:
##########
@@ -283,12 +289,14 @@ public InitContextImpl(
ProcessingTimeService processingTimeService,
MailboxExecutor mailboxExecutor,
SinkWriterMetricGroup metricGroup,
+ StreamConfig operatorConfig,
@Nullable Long restoredCheckpointId) {
this.runtimeContext = checkNotNull(runtimeContext);
this.mailboxExecutor = checkNotNull(mailboxExecutor);
this.processingTimeService = checkNotNull(processingTimeService);
this.metricGroup = checkNotNull(metricGroup);
this.restoredCheckpointId = restoredCheckpointId;
+ this.operatorConfig = operatorConfig;
Review Comment:
Add `checkNotNull`
##########
flink-connectors/flink-connector-base/src/test/java/org/apache/flink/connector/base/sink/writer/TestSinkInitContext.java:
##########
@@ -142,6 +144,21 @@ public SerializationSchema.InitializationContext
asSerializationSchemaInitializa
return null;
}
+ @Override
+ public boolean isObjectReuseEnabled() {
+ return false;
+ }
+
+ @Override
+ public <IN> TypeSerializer<IN> createInputSerializer() {
+ return null;
+ }
+
+ @Override
+ public JobID getJobId() {
+ return new JobID("test".getBytes());
Review Comment:
`return null` is OK
##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/functions/PrintSinkTest.java:
##########
@@ -216,6 +218,21 @@ public OptionalLong getRestoredCheckpointId() {
asSerializationSchemaInitializationContext() {
return this;
}
+
+ @Override
+ public boolean isObjectReuseEnabled() {
+ return false;
+ }
+
+ @Override
+ public <IN> TypeSerializer<IN> createInputSerializer() {
+ return null;
+ }
+
+ @Override
+ public JobID getJobId() {
+ return new JobID("test_print".getBytes());
Review Comment:
`return null` is OK
--
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]