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 2020/10/26 15:55:51 UTC

[GitHub] [flink] kl0u opened a new pull request #13795: [FLINK-19814][FLINK-19815] Do not support iterations in BATCH mode.

kl0u opened a new pull request #13795:
URL: https://github.com/apache/flink/pull/13795


   ## What is the purpose of the change
   
   This PR disables iterations, i.e. `FeedbackTransformation` and `CoFeedbackTransformation`, from the `DataStream` API when executing in `BATCH` mode.
   
   ## Brief change log
   
   The changes are in the `StreamGraphGenerator`.
   
   ## Verifying this change
   
   Added tests in the `StreamGraphGeneratorBatchExecutionTest`.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes / **no** / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / **no**)
     - If yes, how is the feature documented? (**not applicable** / docs / JavaDocs / not documented)
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #13795: [FLINK-19814][FLINK-19815] Do not support iterations in BATCH mode.

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13795:
URL: https://github.com/apache/flink/pull/13795#issuecomment-716644432


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 3d0fe1e9f7cd437aa038a61a75bacff9714e526a (Mon Oct 26 15:58:12 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] kl0u closed pull request #13795: [FLINK-19814][FLINK-19815] Do not support iterations in BATCH mode.

Posted by GitBox <gi...@apache.org>.
kl0u closed pull request #13795:
URL: https://github.com/apache/flink/pull/13795


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] aljoscha commented on a change in pull request #13795: [FLINK-19814][FLINK-19815] Do not support iterations in BATCH mode.

Posted by GitBox <gi...@apache.org>.
aljoscha commented on a change in pull request #13795:
URL: https://github.com/apache/flink/pull/13795#discussion_r512562273



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java
##########
@@ -517,6 +523,12 @@ private boolean isUnboundedSource(final Transformation<?> transformation) {
 	 */
 	private <F> Collection<Integer> transformCoFeedback(CoFeedbackTransformation<F> coIterate) {
 
+		if (shouldExecuteInBatchMode) {
+			throw new UnsupportedOperationException("Iterations are not supported in BATCH" +
+					" execution mode. If you want to execute such a pipeline, please set the " +
+					"'" + ExecutionOptions.RUNTIME_MODE.key() + "'=STREAMING");

Review comment:
       Same as above.

##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraphGenerator.java
##########
@@ -434,6 +434,12 @@ private boolean isUnboundedSource(final Transformation<?> transformation) {
 	 */
 	private <T> Collection<Integer> transformFeedback(FeedbackTransformation<T> iterate) {
 
+		if (shouldExecuteInBatchMode) {
+			throw new UnsupportedOperationException("Iterations are not supported in BATCH" +
+					" execution mode. If you want to execute such a pipeline, please set the " +
+					"'" + ExecutionOptions.RUNTIME_MODE.key() + "'=STREAMING");

Review comment:
       Should also use the enum value instead of the hardcoded `"STREAMING"` string.

##########
File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/api/graph/StreamGraphGeneratorBatchExecutionTest.java
##########
@@ -381,6 +394,44 @@ public void testInputSelectableMultiInputTransformation() {
 		graphGenerator.generate();
 	}
 
+	@Test
+	public void testFeedbackThrowsExceptionInBatch() {
+		final SourceTransformation<Integer> bounded =
+				new SourceTransformation<>(
+						"Bounded Source",
+						new SourceOperatorFactory<>(new MockSource(Boundedness.BOUNDED, 100), WatermarkStrategy.noWatermarks()),
+						IntegerTypeInfo.of(Integer.class),
+						1);
+
+		final FeedbackTransformation<Integer> feedbackTransformation =
+				new FeedbackTransformation<>(bounded, 5L);
+
+		testNoSupportForIterationsInBatchHelper(bounded, feedbackTransformation);
+	}
+
+	@Test
+	public void testCoFeedbackThrowsExceptionInBatch() {
+		final CoFeedbackTransformation<Integer> coFeedbackTransformation =
+				new CoFeedbackTransformation<>(2, TypeInformation.of(Integer.TYPE), 5L);
+		testNoSupportForIterationsInBatchHelper(coFeedbackTransformation);
+	}
+
+	private void testNoSupportForIterationsInBatchHelper(final Transformation<?>... transformations) {
+		final List<Transformation<?>> registeredTransformations = new ArrayList<>();
+		Collections.addAll(registeredTransformations, transformations);
+
+		StreamGraphGenerator streamGraphGenerator =
+				new StreamGraphGenerator(
+						registeredTransformations,
+						new ExecutionConfig(),
+						new CheckpointConfig());
+		streamGraphGenerator.setRuntimeExecutionMode(RuntimeExecutionMode.AUTOMATIC);

Review comment:
       Why don't you set it to `BATCH` to be more specific in the test?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13795: [FLINK-19814][FLINK-19815] Do not support iterations in BATCH mode.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13795:
URL: https://github.com/apache/flink/pull/13795#issuecomment-716685509


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3d0fe1e9f7cd437aa038a61a75bacff9714e526a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8321",
       "triggerID" : "3d0fe1e9f7cd437aa038a61a75bacff9714e526a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3d0fe1e9f7cd437aa038a61a75bacff9714e526a Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8321) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #13795: [FLINK-19814][FLINK-19815] Do not support iterations in BATCH mode.

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13795:
URL: https://github.com/apache/flink/pull/13795#issuecomment-716685509


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3d0fe1e9f7cd437aa038a61a75bacff9714e526a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "3d0fe1e9f7cd437aa038a61a75bacff9714e526a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3d0fe1e9f7cd437aa038a61a75bacff9714e526a UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13795: [FLINK-19814][FLINK-19815] Do not support iterations in BATCH mode.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13795:
URL: https://github.com/apache/flink/pull/13795#issuecomment-716685509


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3d0fe1e9f7cd437aa038a61a75bacff9714e526a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8321",
       "triggerID" : "3d0fe1e9f7cd437aa038a61a75bacff9714e526a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3d0fe1e9f7cd437aa038a61a75bacff9714e526a Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=8321) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] kl0u commented on pull request #13795: [FLINK-19814][FLINK-19815] Do not support iterations in BATCH mode.

Posted by GitBox <gi...@apache.org>.
kl0u commented on pull request #13795:
URL: https://github.com/apache/flink/pull/13795#issuecomment-717237283


   Thanks for the comments @aljoscha. I integrated them and I will merge soon.


----------------------------------------------------------------
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:
users@infra.apache.org