1u0 commented on a change in pull request #9383: [FLINK-13248] [runtime] Adding
processing of downstream messages in AsyncWaitOperator's wait loops
URL: https://github.com/apache/flink/pull/9383#discussion_r317603086
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java
##########
@@ -1172,8 +1173,10 @@ public ExecutionConfig getExecutionConfig() {
* @param <R>
* type of the return stream
* @return the data stream constructed
+ * @see #transform(String, TypeInformation,
OneInputStreamOperatorFactory)
*/
@PublicEvolving
+ @Deprecated
public <R> SingleOutputStreamOperator<R> transform(String operatorName,
TypeInformation<R> outTypeInfo, OneInputStreamOperator<T, R> operator) {
Review comment:
You can eliminate code duplication (this and the newly introduced method) by
introducing a private method (with more broader `operatorFactory` argument)
like:
```
private <R> SingleOutputStreamOperator<R> transform(
String operatorName, TypeInformation<R> outTypeInfo,
StreamOperatorFactory<T, R> operatorFactory) {
...
}
```
The old methods would just delegate call to the common implementation, for
example:
```
public <R> SingleOutputStreamOperator<R> transform(String operatorName,
TypeInformation<R> outTypeInfo, OneInputStreamOperator<T, R> operator) {
return transform(operatorName, outTypeInfo,
SimpleOperatorFactory.of(operator));
}
```
Regarding, the deprecation of this api: I think this api method is more user
targeted (`OneInputStreamOperator` is `@PublicEvolving`) and it's more or less
ok for users to write their own operators as Java classes.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services