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 2022/05/04 11:56:08 UTC

[GitHub] [flink] fapaul opened a new pull request, #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

fapaul opened a new pull request, #19633:
URL: https://github.com/apache/flink/pull/19633

   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   This commit fixes all archunit violations in the connector-base module.
   
   
   ## Brief change log
   
   0bfb1cb55bfce0145c5a96c7356e5e401993d108 Adds annotation to our documentation tooling that is already used by external connector that want to use the `ConfigOption` class.
   64505ea95895d81ebbb77e316928147b002544a9 Makes the public building blocks of the hybrid source public evolving
   c045f87c97d30d8ce29bc1c3fbb93c62b1ed685e Allows tests inheriting AbstractBase to omit an explicit MiniCluster definition.
   
   
   
   ## Verifying this change
   
   All arch unit tests still pass
   
   ## 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, 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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] zentol commented on a diff in pull request #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

Posted by GitBox <gi...@apache.org>.
zentol commented on code in PR #19633:
URL: https://github.com/apache/flink/pull/19633#discussion_r864777347


##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java:
##########
@@ -108,18 +109,21 @@ public Boundedness getBoundedness() {
         return sources.get(sources.size() - 1).boundedness;
     }
 
+    @Internal

Review Comment:
   it seems strange that overridden methods have such an annotation. Shouldn't that be entirely defined by the interface/class we implement/extend?



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] zentol commented on a diff in pull request #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

Posted by GitBox <gi...@apache.org>.
zentol commented on code in PR #19633:
URL: https://github.com/apache/flink/pull/19633#discussion_r864828620


##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java:
##########
@@ -108,18 +109,21 @@ public Boundedness getBoundedness() {
         return sources.get(sources.size() - 1).boundedness;
     }
 
+    @Internal

Review Comment:
   I guess I'm fine with it then, but I still think it's a bit strange and would've rather pushed for a proper distinction of who consumes a given method.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] fapaul commented on a diff in pull request #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

Posted by GitBox <gi...@apache.org>.
fapaul commented on code in PR #19633:
URL: https://github.com/apache/flink/pull/19633#discussion_r864782675


##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java:
##########
@@ -108,18 +109,21 @@ public Boundedness getBoundedness() {
         return sources.get(sources.size() - 1).boundedness;
     }
 
+    @Internal

Review Comment:
   I think one important piece that is currently missing in Flink's annotation is the difference between **usage** and **implementations**. From a base interface perspective, connector developers are supposed to implement the method therefore it is not internal but from a user perspective, it is internal because no user should ever interact with the method. 



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] zentol commented on a diff in pull request #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

Posted by GitBox <gi...@apache.org>.
zentol commented on code in PR #19633:
URL: https://github.com/apache/flink/pull/19633#discussion_r864823526


##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java:
##########
@@ -108,18 +109,21 @@ public Boundedness getBoundedness() {
         return sources.get(sources.size() - 1).boundedness;
     }
 
+    @Internal

Review Comment:
   Good god it actually seems necessary; e.g., KafkaSink#createWrite actually implements 2 interfaces at once 🤯.



##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java:
##########
@@ -108,18 +109,21 @@ public Boundedness getBoundedness() {
         return sources.get(sources.size() - 1).boundedness;
     }
 
+    @Internal

Review Comment:
   Good god it actually seems necessary; e.g., KafkaSink#createWriter actually implements 2 interfaces at once 🤯.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] flinkbot commented on pull request #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c045f87c97d30d8ce29bc1c3fbb93c62b1ed685e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c045f87c97d30d8ce29bc1c3fbb93c62b1ed685e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c045f87c97d30d8ce29bc1c3fbb93c62b1ed685e UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] zentol commented on a diff in pull request #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

Posted by GitBox <gi...@apache.org>.
zentol commented on code in PR #19633:
URL: https://github.com/apache/flink/pull/19633#discussion_r864775773


##########
flink-architecture-tests/flink-architecture-tests-test/src/main/java/org/apache/flink/architecture/rules/ITCaseRules.java:
##########
@@ -126,6 +126,11 @@ public class ITCaseRules {
                                                             // Please refer to FLINK-25858.
                                                             .or(
                                                                     miniClusterWithClientResourceClassRule())
+                                                            .or(
+                                                                    JavaClass.Predicates
+                                                                            .assignableTo(
+                                                                                    AbstractTestBase
+                                                                                            .class))

Review Comment:
   This should be covered by the miniClusterExtensionRule() thing; if it isn't then `containAnyFieldsInClassHierarchyThat` doesn't work as expected.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] zentol commented on a diff in pull request #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

Posted by GitBox <gi...@apache.org>.
zentol commented on code in PR #19633:
URL: https://github.com/apache/flink/pull/19633#discussion_r864786891


##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java:
##########
@@ -108,18 +109,21 @@ public Boundedness getBoundedness() {
         return sources.get(sources.size() - 1).boundedness;
     }
 
+    @Internal

Review Comment:
   That is indeed something that we're missing. We discussed it a while ago and couldn't come up with a definitive answer.
   
   I'd like to avoid trying to work around it this way.
   In practice you can't make a breaking change to this method anyway because the method is still public as defined by the interface (so we don't gain any flexibility to change stuff) nor can you make any assumption that this method is not called because hey, a user might just work against the Source interface where this method is public.
   So...I don't see us gaining anything really.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] fapaul commented on a diff in pull request #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

Posted by GitBox <gi...@apache.org>.
fapaul commented on code in PR #19633:
URL: https://github.com/apache/flink/pull/19633#discussion_r864800518


##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java:
##########
@@ -108,18 +109,21 @@ public Boundedness getBoundedness() {
         return sources.get(sources.size() - 1).boundedness;
     }
 
+    @Internal

Review Comment:
   What is your proposal? We did this approach already for a lot of connectors and so far it made sense. Of course, users can still interact with these methods but the connector gives no guarantee about maintaining the compatibility i.e. the returned serializer changes. Currently, I see two options do it like this or keep the existing violations.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] zentol commented on a diff in pull request #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

Posted by GitBox <gi...@apache.org>.
zentol commented on code in PR #19633:
URL: https://github.com/apache/flink/pull/19633#discussion_r864819082


##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java:
##########
@@ -108,18 +109,21 @@ public Boundedness getBoundedness() {
         return sources.get(sources.size() - 1).boundedness;
     }
 
+    @Internal

Review Comment:
   > We did this approach already for a lot of connectors
   
   Do we? Can you point me to some discussion where we agreed to do this?
   
   > the connector gives no guarantee about maintaining the compatibility i.e. the returned serializer changes.
   
   But the connector can already change whatever it returns so long as it adheres to the interface. I could see issues where the return type is a connector-specific implementation, although then I wonder whether this is actually correct / necessary.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] fapaul commented on a diff in pull request #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

Posted by GitBox <gi...@apache.org>.
fapaul commented on code in PR #19633:
URL: https://github.com/apache/flink/pull/19633#discussion_r864795953


##########
flink-architecture-tests/flink-architecture-tests-test/src/main/java/org/apache/flink/architecture/rules/ITCaseRules.java:
##########
@@ -126,6 +126,11 @@ public class ITCaseRules {
                                                             // Please refer to FLINK-25858.
                                                             .or(
                                                                     miniClusterWithClientResourceClassRule())
+                                                            .or(
+                                                                    JavaClass.Predicates
+                                                                            .assignableTo(
+                                                                                    AbstractTestBase
+                                                                                            .class))

Review Comment:
   Good catch, this change is unnecessary I reverted it.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] zentol commented on a diff in pull request #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

Posted by GitBox <gi...@apache.org>.
zentol commented on code in PR #19633:
URL: https://github.com/apache/flink/pull/19633#discussion_r864823526


##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java:
##########
@@ -108,18 +109,21 @@ public Boundedness getBoundedness() {
         return sources.get(sources.size() - 1).boundedness;
     }
 
+    @Internal

Review Comment:
   Good god it actually seems necessary; e.g., KafkaSink#createWriter actually implements 2 distinct interfaces at once 🤯.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] fapaul commented on a diff in pull request #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

Posted by GitBox <gi...@apache.org>.
fapaul commented on code in PR #19633:
URL: https://github.com/apache/flink/pull/19633#discussion_r865816365


##########
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/hybrid/HybridSource.java:
##########
@@ -108,18 +109,21 @@ public Boundedness getBoundedness() {
         return sources.get(sources.size() - 1).boundedness;
     }
 
+    @Internal

Review Comment:
   > Good god it actually seems necessary; e.g., KafkaSink#createWriter actually implements 2 distinct interfaces at once 🤯.
   
   That was one of the design decisions for the new interface. That connector developer can choose which methods to implement and make it transparent for the end-user. Indeed that reduces a bit the readability.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] fapaul merged pull request #19633: [FLINK-27486] Fix all archunit violations in flink-connector-base module

Posted by GitBox <gi...@apache.org>.
fapaul merged PR #19633:
URL: https://github.com/apache/flink/pull/19633


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org