From 78d9ae9ba3ddda4b84d335b07ece7c04b18d4751 Mon Sep 17 00:00:00 2001 From: Stephan Ewen Date: Tue, 30 Aug 2016 12:28:07 +0200 Subject: [PATCH] [FLINK-4271] [DataStream API] Extends JavaDocs for 'apply(...)' and 'with(...)' functions. --- .../api/datastream/CoGroupedStreams.java | 32 +++++++---- .../api/datastream/JoinedStreams.java | 56 +++++++++++++------ 2 files changed, 59 insertions(+), 29 deletions(-) diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/CoGroupedStreams.java b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/CoGroupedStreams.java index 0bab4cf4dee..62d032da600 100644 --- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/CoGroupedStreams.java +++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/CoGroupedStreams.java @@ -224,6 +224,10 @@ public class CoGroupedStreams { /** * Completes the co-group operation with the user function that is executed * for windowed groups. + * + *

Note: This method's return type does not support setting an operator-specific parallelism. + * Due to binary backwards compatibility, this cannot be altered. Use the {@link #with(CoGroupFunction)} + * method to set an operator-specific parallelism. */ public DataStream apply(CoGroupFunction function) { @@ -244,12 +248,13 @@ public class CoGroupedStreams { * Completes the co-group operation with the user function that is executed * for windowed groups. * - *

- * Note: This is a temporary workaround while the {@link #apply(CoGroupFunction)} method has the wrong return type. - *

- * @deprecated This method will be replaced by {@link #apply(CoGroupFunction)} in Flink 2.0. - * So use the {@link #apply(CoGroupFunction)} in the future. - */ + *

Note: This is a temporary workaround while the {@link #apply(CoGroupFunction)} + * method has the wrong return type and hence does not allow one to set an operator-specific + * parallelism + * + * @deprecated This method will be removed once the {@link #apply(CoGroupFunction)} method is fixed + * in the next major version of Flink (2.0). + */ @PublicEvolving @Deprecated public SingleOutputStreamOperator with(CoGroupFunction function) { @@ -259,6 +264,10 @@ public class CoGroupedStreams { /** * Completes the co-group operation with the user function that is executed * for windowed groups. + * + *

Note: This method's return type does not support setting an operator-specific parallelism. + * Due to binary backwards compatibility, this cannot be altered. Use the + * {@link #with(CoGroupFunction, TypeInformation)} method to set an operator-specific parallelism. */ public DataStream apply(CoGroupFunction function, TypeInformation resultType) { //clean the closure @@ -297,11 +306,12 @@ public class CoGroupedStreams { * Completes the co-group operation with the user function that is executed * for windowed groups. * - *

- * Note: This is a temporary workaround while the {@link #apply(CoGroupFunction, TypeInformation)} method has the wrong return type. - *

- * @deprecated This method will be replaced by {@link #apply(CoGroupFunction, TypeInformation)} in Flink 2.0. - * So use the {@link #apply(CoGroupFunction, TypeInformation)} in the future. + *

Note: This is a temporary workaround while the {@link #apply(CoGroupFunction, TypeInformation)} + * method has the wrong return type and hence does not allow one to set an operator-specific + * parallelism + * + * @deprecated This method will be removed once the {@link #apply(CoGroupFunction, TypeInformation)} + * method is fixed in the next major version of Flink (2.0). */ @PublicEvolving @Deprecated diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/JoinedStreams.java b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/JoinedStreams.java index 8f8fc675758..c0053105c7f 100644 --- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/JoinedStreams.java +++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/JoinedStreams.java @@ -219,6 +219,10 @@ public class JoinedStreams { /** * Completes the join operation with the user function that is executed * for each combination of elements with the same key in a window. + * + *

Note: This method's return type does not support setting an operator-specific parallelism. + * Due to binary backwards compatibility, this cannot be altered. Use the {@link #with(JoinFunction)} + * method to set an operator-specific parallelism. */ public DataStream apply(JoinFunction function) { TypeInformation resultType = TypeExtractor.getBinaryOperatorReturnType( @@ -238,11 +242,12 @@ public class JoinedStreams { * Completes the join operation with the user function that is executed * for each combination of elements with the same key in a window. * - *

- * Note: This is a temporary workaround while the {@link #apply(JoinFunction)} method has the wrong return type. - *

- * @deprecated This method will be replaced by {@link #apply(JoinFunction)} in Flink 2.0. - * So use the {@link #apply(JoinFunction)} in the future. + *

Note: This is a temporary workaround while the {@link #apply(JoinFunction)} + * method has the wrong return type and hence does not allow one to set an operator-specific + * parallelism + * + * @deprecated This method will be removed once the {@link #apply(JoinFunction)} method is fixed + * in the next major version of Flink (2.0). */ @PublicEvolving @Deprecated @@ -253,6 +258,10 @@ public class JoinedStreams { /** * Completes the join operation with the user function that is executed * for each combination of elements with the same key in a window. + * + *

Note: This method's return type does not support setting an operator-specific parallelism. + * Due to binary backwards compatibility, this cannot be altered. Use the + * {@link #with(JoinFunction, TypeInformation)}, method to set an operator-specific parallelism. */ public DataStream apply(FlatJoinFunction function, TypeInformation resultType) { //clean the closure @@ -273,9 +282,10 @@ public class JoinedStreams { * Completes the join operation with the user function that is executed * for each combination of elements with the same key in a window. * - *

- * Note: This is a temporary workaround while the {@link #apply(FlatJoinFunction, TypeInformation)} method has the wrong return type. - *

+ *

Note: This is a temporary workaround while the {@link #apply(JoinFunction, TypeInformation)} + * method has the wrong return type and hence does not allow one to set an operator-specific + * parallelism + * * @deprecated This method will be replaced by {@link #apply(FlatJoinFunction, TypeInformation)} in Flink 2.0. * So use the {@link #apply(FlatJoinFunction, TypeInformation)} in the future. */ @@ -288,6 +298,10 @@ public class JoinedStreams { /** * Completes the join operation with the user function that is executed * for each combination of elements with the same key in a window. + * + *

Note: This method's return type does not support setting an operator-specific parallelism. + * Due to binary backwards compatibility, this cannot be altered. Use the + * {@link #with(FlatJoinFunction)}, method to set an operator-specific parallelism. */ public DataStream apply(FlatJoinFunction function) { TypeInformation resultType = TypeExtractor.getBinaryOperatorReturnType( @@ -307,11 +321,12 @@ public class JoinedStreams { * Completes the join operation with the user function that is executed * for each combination of elements with the same key in a window. * - *

- * Note: This is a temporary workaround while the {@link #apply(FlatJoinFunction)} method has the wrong return type. - *

- * @deprecated This method will be replaced by {@link #apply(FlatJoinFunction)} in Flink 2.0. - * So use the {@link #apply(FlatJoinFunction)} in the future. + *

Note: This is a temporary workaround while the {@link #apply(FlatJoinFunction)} + * method has the wrong return type and hence does not allow one to set an operator-specific + * parallelism. + * + * @deprecated This method will be removed once the {@link #apply(FlatJoinFunction)} + * method is fixed in the next major version of Flink (2.0). */ @PublicEvolving @Deprecated @@ -322,6 +337,10 @@ public class JoinedStreams { /** * Completes the join operation with the user function that is executed * for each combination of elements with the same key in a window. + * + *

Note: This method's return type does not support setting an operator-specific parallelism. + * Due to binary backwards compatibility, this cannot be altered. Use the + * {@link #with(JoinFunction, TypeInformation)}, method to set an operator-specific parallelism. */ public DataStream apply(JoinFunction function, TypeInformation resultType) { //clean the closure @@ -341,11 +360,12 @@ public class JoinedStreams { * Completes the join operation with the user function that is executed * for each combination of elements with the same key in a window. * - *

- * Note: This is a temporary workaround while the {@link #apply(JoinFunction, TypeInformation)} method has the wrong return type. - *

- * @deprecated This method will be replaced by {@link #apply(JoinFunction, TypeInformation)} in Flink 2.0. - * So use the {@link #apply(JoinFunction, TypeInformation)} in the future. + *

Note: This is a temporary workaround while the {@link #apply(FlatJoinFunction, TypeInformation)} + * method has the wrong return type and hence does not allow one to set an operator-specific + * parallelism + * + * @deprecated This method will be removed once the {@link #apply(JoinFunction, TypeInformation)} + * method is fixed in the next major version of Flink (2.0). */ @PublicEvolving @Deprecated -- GitLab