You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by fp...@apache.org on 2022/05/05 11:52:09 UTC

[flink] branch master updated (c4a3c04bdb4 -> 09358d1fead)

This is an automated email from the ASF dual-hosted git repository.

fpaul pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


    from c4a3c04bdb4 [hotfix][k8s][tests] Fix import
     new b6eaefcf1da [FLINK-27486][core] Mark documentation formatting tools as PublicEvolving
     new 439a97fac66 [FLINK-27486][hybrid] Make hybrid source building blocks as PublicEvolving
     new 09358d1fead [FLINK-27486][tests] Fix archunit test violations in connector-base module

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../5b9eed8a-5fb6-4373-98ac-3be2a71941b8           | 16 -----------
 .../84abeb9c-8355-4165-96aa-dda65b04e5e7           |  2 +-
 .../8ab2328f-b38b-4e34-b768-0deb6b6171fb           | 12 ---------
 .../connector/base/source/hybrid/HybridSource.java |  9 +++++++
 .../connector/base/sink/AsyncSinkBaseITCase.java   | 31 +++++++++++++++-------
 .../reader/CoordinatedSourceRescaleITCase.java     | 14 +++++++++-
 .../configuration/description/BlockElement.java    |  3 +++
 .../configuration/description/Description.java     |  4 +++
 .../description/DescriptionElement.java            |  3 +++
 .../flink/configuration/description/Formatter.java |  3 +++
 .../configuration/description/InlineElement.java   |  3 +++
 .../description/LineBreakElement.java              |  3 +++
 .../configuration/description/LinkElement.java     |  3 +++
 .../configuration/description/ListElement.java     |  3 +++
 .../configuration/description/TextElement.java     |  4 +++
 15 files changed, 73 insertions(+), 40 deletions(-)


[flink] 01/03: [FLINK-27486][core] Mark documentation formatting tools as PublicEvolving

Posted by fp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

fpaul pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit b6eaefcf1da545b61946a793e34c7cee2c2360f2
Author: Fabian Paul <fa...@ververica.com>
AuthorDate: Wed May 4 10:50:49 2022 +0200

    [FLINK-27486][core] Mark documentation formatting tools as PublicEvolving
---
 .../archunit-violations/5b9eed8a-5fb6-4373-98ac-3be2a71941b8         | 5 -----
 .../org/apache/flink/configuration/description/BlockElement.java     | 3 +++
 .../java/org/apache/flink/configuration/description/Description.java | 4 ++++
 .../apache/flink/configuration/description/DescriptionElement.java   | 3 +++
 .../java/org/apache/flink/configuration/description/Formatter.java   | 3 +++
 .../org/apache/flink/configuration/description/InlineElement.java    | 3 +++
 .../org/apache/flink/configuration/description/LineBreakElement.java | 3 +++
 .../java/org/apache/flink/configuration/description/LinkElement.java | 3 +++
 .../java/org/apache/flink/configuration/description/ListElement.java | 3 +++
 .../java/org/apache/flink/configuration/description/TextElement.java | 4 ++++
 10 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/flink-architecture-tests/flink-architecture-tests-production/archunit-violations/5b9eed8a-5fb6-4373-98ac-3be2a71941b8 b/flink-architecture-tests/flink-architecture-tests-production/archunit-violations/5b9eed8a-5fb6-4373-98ac-3be2a71941b8
index 6c1748c842d..8b4e3ad7aaa 100644
--- a/flink-architecture-tests/flink-architecture-tests-production/archunit-violations/5b9eed8a-5fb6-4373-98ac-3be2a71941b8
+++ b/flink-architecture-tests/flink-architecture-tests-production/archunit-violations/5b9eed8a-5fb6-4373-98ac-3be2a71941b8
@@ -1,4 +1,3 @@
-org.apache.flink.api.common.BatchShuffleMode.getDescription(): Returned leaf type org.apache.flink.configuration.description.InlineElement does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.api.common.ExecutionConfig.getRestartStrategy(): Returned leaf type org.apache.flink.api.common.restartstrategy.RestartStrategies$RestartStrategyConfiguration does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.api.common.ExecutionConfig.setRestartStrategy(org.apache.flink.api.common.restartstrategy.RestartStrategies$RestartStrategyConfiguration): Argument leaf type org.apache.flink.api.common.restartstrategy.RestartStrategies$RestartStrategyConfiguration does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.api.common.eventtime.TimestampAssignerSupplier.createTimestampAssigner(org.apache.flink.api.common.eventtime.TimestampAssignerSupplier$Context): Argument leaf type org.apache.flink.api.common.eventtime.TimestampAssignerSupplier$Context does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
@@ -49,13 +48,9 @@ org.apache.flink.client.program.StreamContextEnvironment.setAsContext(org.apache
 org.apache.flink.client.program.StreamPlanEnvironment.executeAsync(org.apache.flink.streaming.api.graph.StreamGraph): Argument leaf type org.apache.flink.streaming.api.graph.StreamGraph does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.client.program.StreamPlanEnvironment.getPipeline(): Returned leaf type org.apache.flink.api.dag.Pipeline does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.configuration.ClusterOptions.getSchedulerType(org.apache.flink.configuration.Configuration): Returned leaf type org.apache.flink.configuration.JobManagerOptions$SchedulerType does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
-org.apache.flink.configuration.ConfigOption.description(): Returned leaf type org.apache.flink.configuration.description.Description does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.configuration.ConfigOption.fallbackKeys(): Returned leaf type org.apache.flink.configuration.FallbackKey does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
-org.apache.flink.configuration.ConfigOption.withDescription(org.apache.flink.configuration.description.Description): Argument leaf type org.apache.flink.configuration.description.Description does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.configuration.ConfigOptions.key(java.lang.String): Returned leaf type org.apache.flink.configuration.ConfigOptions$OptionBuilder does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
-org.apache.flink.configuration.DescribedEnum.getDescription(): Returned leaf type org.apache.flink.configuration.description.InlineElement does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.configuration.MemorySize.parse(java.lang.String, org.apache.flink.configuration.MemorySize$MemoryUnit): Argument leaf type org.apache.flink.configuration.MemorySize$MemoryUnit does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
-org.apache.flink.connector.base.DeliveryGuarantee.getDescription(): Returned leaf type org.apache.flink.configuration.description.InlineElement does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.connector.base.source.hybrid.HybridSource.builder(org.apache.flink.api.connector.source.Source): Returned leaf type org.apache.flink.connector.base.source.hybrid.HybridSource$HybridSourceBuilder does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.connector.base.source.hybrid.HybridSource.createEnumerator(org.apache.flink.api.connector.source.SplitEnumeratorContext): Argument leaf type org.apache.flink.connector.base.source.hybrid.HybridSourceSplit does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.connector.base.source.hybrid.HybridSource.createEnumerator(org.apache.flink.api.connector.source.SplitEnumeratorContext): Returned leaf type org.apache.flink.connector.base.source.hybrid.HybridSourceEnumeratorState does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/description/BlockElement.java b/flink-core/src/main/java/org/apache/flink/configuration/description/BlockElement.java
index 89aba81609f..48dfba492ba 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/description/BlockElement.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/description/BlockElement.java
@@ -18,5 +18,8 @@
 
 package org.apache.flink.configuration.description;
 
+import org.apache.flink.annotation.PublicEvolving;
+
 /** Part of description that represents a block e.g. some text, linebreak or a list. */
+@PublicEvolving
 public interface BlockElement extends DescriptionElement {}
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/description/Description.java b/flink-core/src/main/java/org/apache/flink/configuration/description/Description.java
index 0f9d3e28a55..9e92bfca57b 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/description/Description.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/description/Description.java
@@ -18,6 +18,8 @@
 
 package org.apache.flink.configuration.description;
 
+import org.apache.flink.annotation.PublicEvolving;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -25,6 +27,7 @@ import java.util.List;
  * Description for {@link org.apache.flink.configuration.ConfigOption}. Allows providing multiple
  * rich formats.
  */
+@PublicEvolving
 public class Description {
 
     private final List<BlockElement> blocks;
@@ -50,6 +53,7 @@ public class Description {
      * 	.build();
      * }</pre>
      */
+    @PublicEvolving
     public static class DescriptionBuilder {
 
         private final List<BlockElement> blocks = new ArrayList<>();
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/description/DescriptionElement.java b/flink-core/src/main/java/org/apache/flink/configuration/description/DescriptionElement.java
index 9a8f8a18b51..56b64c4a458 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/description/DescriptionElement.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/description/DescriptionElement.java
@@ -18,7 +18,10 @@
 
 package org.apache.flink.configuration.description;
 
+import org.apache.flink.annotation.PublicEvolving;
+
 /** Part of a {@link Description} that can be converted into String representation. */
+@PublicEvolving
 interface DescriptionElement {
     /**
      * Transforms itself into String representation using given format.
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/description/Formatter.java b/flink-core/src/main/java/org/apache/flink/configuration/description/Formatter.java
index 0198ae94020..3dcd89f8883 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/description/Formatter.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/description/Formatter.java
@@ -18,12 +18,15 @@
 
 package org.apache.flink.configuration.description;
 
+import org.apache.flink.annotation.PublicEvolving;
+
 import java.util.EnumSet;
 
 /**
  * Allows providing multiple formatters for the description. E.g. Html formatter, Markdown formatter
  * etc.
  */
+@PublicEvolving
 public abstract class Formatter {
 
     private final StringBuilder state = new StringBuilder();
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/description/InlineElement.java b/flink-core/src/main/java/org/apache/flink/configuration/description/InlineElement.java
index d67412bdfac..c1d3892fb90 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/description/InlineElement.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/description/InlineElement.java
@@ -18,5 +18,8 @@
 
 package org.apache.flink.configuration.description;
 
+import org.apache.flink.annotation.PublicEvolving;
+
 /** Part of description that represents an element inside a block e.g. a link. */
+@PublicEvolving
 public interface InlineElement extends DescriptionElement {}
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/description/LineBreakElement.java b/flink-core/src/main/java/org/apache/flink/configuration/description/LineBreakElement.java
index e7aa7eed4cb..625e1a498ab 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/description/LineBreakElement.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/description/LineBreakElement.java
@@ -18,7 +18,10 @@
 
 package org.apache.flink.configuration.description;
 
+import org.apache.flink.annotation.PublicEvolving;
+
 /** Represents a line break in the {@link Description}. */
+@PublicEvolving
 public class LineBreakElement implements InlineElement, BlockElement {
 
     /** Creates a line break in the description. */
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/description/LinkElement.java b/flink-core/src/main/java/org/apache/flink/configuration/description/LinkElement.java
index f60c64ae46a..b55b9056f47 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/description/LinkElement.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/description/LinkElement.java
@@ -18,7 +18,10 @@
 
 package org.apache.flink.configuration.description;
 
+import org.apache.flink.annotation.PublicEvolving;
+
 /** Element that represents a link in the {@link Description}. */
+@PublicEvolving
 public class LinkElement implements InlineElement {
     private final String link;
     private final String text;
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/description/ListElement.java b/flink-core/src/main/java/org/apache/flink/configuration/description/ListElement.java
index d25c4657831..f592673045a 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/description/ListElement.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/description/ListElement.java
@@ -18,10 +18,13 @@
 
 package org.apache.flink.configuration.description;
 
+import org.apache.flink.annotation.PublicEvolving;
+
 import java.util.Arrays;
 import java.util.List;
 
 /** Represents a list in the {@link Description}. */
+@PublicEvolving
 public class ListElement implements BlockElement {
 
     private final List<InlineElement> entries;
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/description/TextElement.java b/flink-core/src/main/java/org/apache/flink/configuration/description/TextElement.java
index 348b174160e..0e0ec7e4e70 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/description/TextElement.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/description/TextElement.java
@@ -18,6 +18,8 @@
 
 package org.apache.flink.configuration.description;
 
+import org.apache.flink.annotation.PublicEvolving;
+
 import org.apache.flink.shaded.guava30.com.google.common.base.Strings;
 
 import java.util.Arrays;
@@ -26,6 +28,7 @@ import java.util.EnumSet;
 import java.util.List;
 
 /** Represents a text block in the {@link Description}. */
+@PublicEvolving
 public class TextElement implements BlockElement, InlineElement {
     private final String format;
     private final List<InlineElement> elements;
@@ -95,6 +98,7 @@ public class TextElement implements BlockElement, InlineElement {
     }
 
     /** Styles that can be applied to {@link TextElement} e.g. code, bold etc. */
+    @PublicEvolving
     public enum TextStyle {
         CODE
     }


[flink] 03/03: [FLINK-27486][tests] Fix archunit test violations in connector-base module

Posted by fp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

fpaul pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 09358d1fead500169a887c81a81afc26f5aef315
Author: Fabian Paul <fa...@ververica.com>
AuthorDate: Wed May 4 11:29:08 2022 +0200

    [FLINK-27486][tests] Fix archunit test violations in connector-base module
---
 .../84abeb9c-8355-4165-96aa-dda65b04e5e7           |  2 +-
 .../8ab2328f-b38b-4e34-b768-0deb6b6171fb           | 12 ---------
 .../connector/base/sink/AsyncSinkBaseITCase.java   | 31 +++++++++++++++-------
 .../reader/CoordinatedSourceRescaleITCase.java     | 14 +++++++++-
 4 files changed, 35 insertions(+), 24 deletions(-)

diff --git a/flink-connectors/flink-connector-aws-kinesis-streams/archunit-violations/84abeb9c-8355-4165-96aa-dda65b04e5e7 b/flink-connectors/flink-connector-aws-kinesis-streams/archunit-violations/84abeb9c-8355-4165-96aa-dda65b04e5e7
index 202fdf191ca..7c90aa63637 100644
--- a/flink-connectors/flink-connector-aws-kinesis-streams/archunit-violations/84abeb9c-8355-4165-96aa-dda65b04e5e7
+++ b/flink-connectors/flink-connector-aws-kinesis-streams/archunit-violations/84abeb9c-8355-4165-96aa-dda65b04e5e7
@@ -3,4 +3,4 @@ org.apache.flink.connector.kinesis.sink.KinesisStreamsSinkITCase does not satisf
 * reside outside of package 'org.apache.flink.runtime.*' and contain any fields that are static, final, and of type MiniClusterExtension and annotated with @RegisterExtension\
 * reside in a package 'org.apache.flink.runtime.*' and is annotated with @ExtendWith with class InternalMiniClusterExtension\
 * reside outside of package 'org.apache.flink.runtime.*' and is annotated with @ExtendWith with class MiniClusterExtension\
- or contain any fields that are public, static, and of type MiniClusterWithClientResource and final and annotated with @ClassRule or contain any fields that is of type MiniClusterWithClientResource and public and final and not static and annotated with @Rule
+ or contain any fields that are public, static, and of type MiniClusterWithClientResource and final and annotated with @ClassRule or contain any fields that is of type MiniClusterWithClientResource and public and final and not static and annotated with @Rule
\ No newline at end of file
diff --git a/flink-connectors/flink-connector-base/archunit-violations/8ab2328f-b38b-4e34-b768-0deb6b6171fb b/flink-connectors/flink-connector-base/archunit-violations/8ab2328f-b38b-4e34-b768-0deb6b6171fb
index 03ba5016523..e69de29bb2d 100644
--- a/flink-connectors/flink-connector-base/archunit-violations/8ab2328f-b38b-4e34-b768-0deb6b6171fb
+++ b/flink-connectors/flink-connector-base/archunit-violations/8ab2328f-b38b-4e34-b768-0deb6b6171fb
@@ -1,12 +0,0 @@
-org.apache.flink.connector.base.sink.AsyncSinkBaseITCase does not satisfy: only one of the following predicates match:\
-* reside in a package 'org.apache.flink.runtime.*' and contain any fields that are static, final, and of type InternalMiniClusterExtension and annotated with @RegisterExtension\
-* reside outside of package 'org.apache.flink.runtime.*' and contain any fields that are static, final, and of type MiniClusterExtension and annotated with @RegisterExtension\
-* reside in a package 'org.apache.flink.runtime.*' and is annotated with @ExtendWith with class InternalMiniClusterExtension\
-* reside outside of package 'org.apache.flink.runtime.*' and is annotated with @ExtendWith with class MiniClusterExtension\
- or contain any fields that are public, static, and of type MiniClusterWithClientResource and final and annotated with @ClassRule or contain any fields that is of type MiniClusterWithClientResource and public and final and not static and annotated with @Rule
-org.apache.flink.connector.base.source.reader.CoordinatedSourceRescaleITCase does not satisfy: only one of the following predicates match:\
-* reside in a package 'org.apache.flink.runtime.*' and contain any fields that are static, final, and of type InternalMiniClusterExtension and annotated with @RegisterExtension\
-* reside outside of package 'org.apache.flink.runtime.*' and contain any fields that are static, final, and of type MiniClusterExtension and annotated with @RegisterExtension\
-* reside in a package 'org.apache.flink.runtime.*' and is annotated with @ExtendWith with class InternalMiniClusterExtension\
-* reside outside of package 'org.apache.flink.runtime.*' and is annotated with @ExtendWith with class MiniClusterExtension\
- or contain any fields that are public, static, and of type MiniClusterWithClientResource and final and annotated with @ClassRule or contain any fields that is of type MiniClusterWithClientResource and public and final and not static and annotated with @Rule
\ No newline at end of file
diff --git a/flink-connectors/flink-connector-base/src/test/java/org/apache/flink/connector/base/sink/AsyncSinkBaseITCase.java b/flink-connectors/flink-connector-base/src/test/java/org/apache/flink/connector/base/sink/AsyncSinkBaseITCase.java
index 1236c72a2c4..d780b85df57 100644
--- a/flink-connectors/flink-connector-base/src/test/java/org/apache/flink/connector/base/sink/AsyncSinkBaseITCase.java
+++ b/flink-connectors/flink-connector-base/src/test/java/org/apache/flink/connector/base/sink/AsyncSinkBaseITCase.java
@@ -20,16 +20,29 @@ package org.apache.flink.connector.base.sink;
 import org.apache.flink.api.common.restartstrategy.RestartStrategies;
 import org.apache.flink.api.common.time.Time;
 import org.apache.flink.runtime.client.JobExecutionException;
+import org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration;
 import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.test.junit5.MiniClusterExtension;
+import org.apache.flink.util.TestLoggerExtension;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThrows;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** Integration tests of a baseline generic sink that implements the AsyncSinkBase. */
+@ExtendWith(TestLoggerExtension.class)
 public class AsyncSinkBaseITCase {
 
+    @RegisterExtension
+    private static final MiniClusterExtension MINI_CLUSTER_RESOURCE =
+            new MiniClusterExtension(
+                    new MiniClusterResourceConfiguration.Builder()
+                            .setNumberTaskManagers(1)
+                            .setNumberSlotsPerTaskManager(1)
+                            .build());
+
     final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
 
     @Test
@@ -43,13 +56,11 @@ public class AsyncSinkBaseITCase {
         env.fromSequence(999_999, 1_000_100)
                 .map(Object::toString)
                 .sinkTo(new ArrayListAsyncSink(1, 1, 2, 10, 1000, 10));
-        Exception e =
-                assertThrows(
-                        JobExecutionException.class,
-                        () -> env.execute("Integration Test: AsyncSinkBaseITCase"));
-        assertEquals(
-                "Intentional error on persisting 1_000_000 to ArrayListDestination",
-                e.getCause().getCause().getMessage());
+        assertThatThrownBy(() -> env.execute("Integration Test: AsyncSinkBaseITCase"))
+                .isInstanceOf(JobExecutionException.class)
+                .getRootCause()
+                .hasMessageContaining(
+                        "Intentional error on persisting 1_000_000 to ArrayListDestination");
     }
 
     @Test
diff --git a/flink-connectors/flink-connector-base/src/test/java/org/apache/flink/connector/base/source/reader/CoordinatedSourceRescaleITCase.java b/flink-connectors/flink-connector-base/src/test/java/org/apache/flink/connector/base/source/reader/CoordinatedSourceRescaleITCase.java
index 0120fee224f..3a23ba8681c 100644
--- a/flink-connectors/flink-connector-base/src/test/java/org/apache/flink/connector/base/source/reader/CoordinatedSourceRescaleITCase.java
+++ b/flink-connectors/flink-connector-base/src/test/java/org/apache/flink/connector/base/source/reader/CoordinatedSourceRescaleITCase.java
@@ -26,12 +26,15 @@ import org.apache.flink.configuration.MemorySize;
 import org.apache.flink.configuration.TaskManagerOptions;
 import org.apache.flink.core.testutils.FlinkMatchers;
 import org.apache.flink.runtime.jobgraph.SavepointConfigOptions;
+import org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration;
 import org.apache.flink.streaming.api.datastream.DataStream;
 import org.apache.flink.streaming.api.environment.CheckpointConfig;
 import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
 import org.apache.flink.streaming.api.functions.sink.SinkFunction;
+import org.apache.flink.test.util.MiniClusterWithClientResource;
 import org.apache.flink.util.TestLogger;
 
+import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -55,6 +58,14 @@ public class CoordinatedSourceRescaleITCase extends TestLogger {
     public static final String CREATED_CHECKPOINT = "successfully created checkpoint";
     public static final String RESTORED_CHECKPOINT = "successfully restored checkpoint";
 
+    @ClassRule
+    public static final MiniClusterWithClientResource MINI_CLUSTER =
+            new MiniClusterWithClientResource(
+                    new MiniClusterResourceConfiguration.Builder()
+                            .setNumberTaskManagers(1)
+                            .setNumberSlotsPerTaskManager(7)
+                            .build());
+
     @Rule public final TemporaryFolder temp = new TemporaryFolder();
 
     @Test
@@ -115,7 +126,8 @@ public class CoordinatedSourceRescaleITCase extends TestLogger {
         conf.setInteger(TaskManagerOptions.NUM_TASK_SLOTS, p);
 
         final StreamExecutionEnvironment env =
-                StreamExecutionEnvironment.createLocalEnvironment(p, conf);
+                StreamExecutionEnvironment.getExecutionEnvironment(conf);
+        env.setParallelism(p);
         env.enableCheckpointing(100);
         env.getCheckpointConfig()
                 .setExternalizedCheckpointCleanup(


[flink] 02/03: [FLINK-27486][hybrid] Make hybrid source building blocks as PublicEvolving

Posted by fp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

fpaul pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 439a97fac667eece8a9c6c17775c342a7b3ba329
Author: Fabian Paul <fa...@ververica.com>
AuthorDate: Wed May 4 10:57:55 2022 +0200

    [FLINK-27486][hybrid] Make hybrid source building blocks as PublicEvolving
---
 .../archunit-violations/5b9eed8a-5fb6-4373-98ac-3be2a71941b8  | 11 -----------
 .../flink/connector/base/source/hybrid/HybridSource.java      |  9 +++++++++
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/flink-architecture-tests/flink-architecture-tests-production/archunit-violations/5b9eed8a-5fb6-4373-98ac-3be2a71941b8 b/flink-architecture-tests/flink-architecture-tests-production/archunit-violations/5b9eed8a-5fb6-4373-98ac-3be2a71941b8
index 8b4e3ad7aaa..f4ca020c770 100644
--- a/flink-architecture-tests/flink-architecture-tests-production/archunit-violations/5b9eed8a-5fb6-4373-98ac-3be2a71941b8
+++ b/flink-architecture-tests/flink-architecture-tests-production/archunit-violations/5b9eed8a-5fb6-4373-98ac-3be2a71941b8
@@ -51,17 +51,6 @@ org.apache.flink.configuration.ClusterOptions.getSchedulerType(org.apache.flink.
 org.apache.flink.configuration.ConfigOption.fallbackKeys(): Returned leaf type org.apache.flink.configuration.FallbackKey does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.configuration.ConfigOptions.key(java.lang.String): Returned leaf type org.apache.flink.configuration.ConfigOptions$OptionBuilder does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.configuration.MemorySize.parse(java.lang.String, org.apache.flink.configuration.MemorySize$MemoryUnit): Argument leaf type org.apache.flink.configuration.MemorySize$MemoryUnit does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
-org.apache.flink.connector.base.source.hybrid.HybridSource.builder(org.apache.flink.api.connector.source.Source): Returned leaf type org.apache.flink.connector.base.source.hybrid.HybridSource$HybridSourceBuilder does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
-org.apache.flink.connector.base.source.hybrid.HybridSource.createEnumerator(org.apache.flink.api.connector.source.SplitEnumeratorContext): Argument leaf type org.apache.flink.connector.base.source.hybrid.HybridSourceSplit does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
-org.apache.flink.connector.base.source.hybrid.HybridSource.createEnumerator(org.apache.flink.api.connector.source.SplitEnumeratorContext): Returned leaf type org.apache.flink.connector.base.source.hybrid.HybridSourceEnumeratorState does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
-org.apache.flink.connector.base.source.hybrid.HybridSource.createEnumerator(org.apache.flink.api.connector.source.SplitEnumeratorContext): Returned leaf type org.apache.flink.connector.base.source.hybrid.HybridSourceSplit does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
-org.apache.flink.connector.base.source.hybrid.HybridSource.createReader(org.apache.flink.api.connector.source.SourceReaderContext): Returned leaf type org.apache.flink.connector.base.source.hybrid.HybridSourceSplit does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
-org.apache.flink.connector.base.source.hybrid.HybridSource.getEnumeratorCheckpointSerializer(): Returned leaf type org.apache.flink.connector.base.source.hybrid.HybridSourceEnumeratorState does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
-org.apache.flink.connector.base.source.hybrid.HybridSource.getSplitSerializer(): Returned leaf type org.apache.flink.connector.base.source.hybrid.HybridSourceSplit does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
-org.apache.flink.connector.base.source.hybrid.HybridSource.restoreEnumerator(org.apache.flink.api.connector.source.SplitEnumeratorContext, org.apache.flink.connector.base.source.hybrid.HybridSourceEnumeratorState): Argument leaf type org.apache.flink.connector.base.source.hybrid.HybridSourceEnumeratorState does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @ [...]
-org.apache.flink.connector.base.source.hybrid.HybridSource.restoreEnumerator(org.apache.flink.api.connector.source.SplitEnumeratorContext, org.apache.flink.connector.base.source.hybrid.HybridSourceEnumeratorState): Argument leaf type org.apache.flink.connector.base.source.hybrid.HybridSourceSplit does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
-org.apache.flink.connector.base.source.hybrid.HybridSource.restoreEnumerator(org.apache.flink.api.connector.source.SplitEnumeratorContext, org.apache.flink.connector.base.source.hybrid.HybridSourceEnumeratorState): Returned leaf type org.apache.flink.connector.base.source.hybrid.HybridSourceEnumeratorState does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @ [...]
-org.apache.flink.connector.base.source.hybrid.HybridSource.restoreEnumerator(org.apache.flink.api.connector.source.SplitEnumeratorContext, org.apache.flink.connector.base.source.hybrid.HybridSourceEnumeratorState): Returned leaf type org.apache.flink.connector.base.source.hybrid.HybridSourceSplit does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.connector.file.sink.FileSink$BulkFormatBuilder.build(): Returned leaf type org.apache.flink.connector.file.sink.FileSink does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.connector.file.sink.FileSink$BulkFormatBuilder.withOutputFileConfig(org.apache.flink.streaming.api.functions.sink.filesystem.OutputFileConfig): Argument leaf type org.apache.flink.streaming.api.functions.sink.filesystem.OutputFileConfig does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
 org.apache.flink.connector.file.src.AbstractFileSource.getAssignerFactory(): Returned leaf type org.apache.flink.connector.file.src.assigners.FileSplitAssigner$Provider does not satisfy: reside outside of package 'org.apache.flink..' or reside in any package ['..shaded..'] or annotated with @Public or annotated with @PublicEvolving or annotated with @Deprecated
diff --git a/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java b/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java
index 8df875b8156..8e95614f440 100644
--- a/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java
+++ b/flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java
@@ -18,6 +18,7 @@
 
 package org.apache.flink.connector.base.source.hybrid;
 
+import org.apache.flink.annotation.Internal;
 import org.apache.flink.annotation.PublicEvolving;
 import org.apache.flink.api.common.ExecutionConfig;
 import org.apache.flink.api.connector.source.Boundedness;
@@ -108,18 +109,21 @@ public class HybridSource<T> implements Source<T, HybridSourceSplit, HybridSourc
         return sources.get(sources.size() - 1).boundedness;
     }
 
+    @Internal
     @Override
     public SourceReader<T, HybridSourceSplit> createReader(SourceReaderContext readerContext)
             throws Exception {
         return new HybridSourceReader(readerContext);
     }
 
+    @Internal
     @Override
     public SplitEnumerator<HybridSourceSplit, HybridSourceEnumeratorState> createEnumerator(
             SplitEnumeratorContext<HybridSourceSplit> enumContext) {
         return new HybridSourceSplitEnumerator(enumContext, sources, 0, null);
     }
 
+    @Internal
     @Override
     public SplitEnumerator<HybridSourceSplit, HybridSourceEnumeratorState> restoreEnumerator(
             SplitEnumeratorContext<HybridSourceSplit> enumContext,
@@ -129,11 +133,13 @@ public class HybridSource<T> implements Source<T, HybridSourceSplit, HybridSourc
                 enumContext, sources, checkpoint.getCurrentSourceIndex(), checkpoint);
     }
 
+    @Internal
     @Override
     public SimpleVersionedSerializer<HybridSourceSplit> getSplitSerializer() {
         return new HybridSourceSplitSerializer();
     }
 
+    @Internal
     @Override
     public SimpleVersionedSerializer<HybridSourceEnumeratorState>
             getEnumeratorCheckpointSerializer() {
@@ -151,6 +157,7 @@ public class HybridSource<T> implements Source<T, HybridSourceSplit, HybridSourc
      * backward compatible extension, i.e. additional information about the previous source can be
      * supplied in the future.
      */
+    @PublicEvolving
     public interface SourceSwitchContext<EnumT> {
         EnumT getPreviousEnumerator();
     }
@@ -171,6 +178,7 @@ public class HybridSource<T> implements Source<T, HybridSourceSplit, HybridSourc
      * entry point and simply wrapped into the factory, providing the benefit of validation during
      * submission.
      */
+    @PublicEvolving
     @FunctionalInterface
     public interface SourceFactory<
                     T, SourceT extends Source<T, ?, ?>, FromEnumT extends SplitEnumerator>
@@ -210,6 +218,7 @@ public class HybridSource<T> implements Source<T, HybridSourceSplit, HybridSourc
     }
 
     /** Builder for HybridSource. */
+    @PublicEvolving
     public static class HybridSourceBuilder<T, EnumT extends SplitEnumerator>
             implements Serializable {
         private final List<SourceListEntry> sources;