You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/09/25 03:47:36 UTC

[GitHub] [incubator-seatunnel] zhaomin1423 opened a new pull request, #2886: Fix redundant assignment

zhaomin1423 opened a new pull request, #2886:
URL: https://github.com/apache/incubator-seatunnel/pull/2886

   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/incubator-seatunnel/issues).
   
     - Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   
   -->
   
   ## Purpose of this pull request
   
   <!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
   
   ## Check list
   
   * [ ] Code changed are covered with tests, or it does not need tests for reason:
   * [ ] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/incubator-seatunnel/tree/dev/docs
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] Hisoka-X commented on pull request #2886: Fix redundant assignment

Posted by GitBox <gi...@apache.org>.
Hisoka-X commented on PR #2886:
URL: https://github.com/apache/incubator-seatunnel/pull/2886#issuecomment-1257660564

   ```java
   Serializable[][] parameterValues = getParameterValues(partitionParameter.minValue, partitionParameter.maxValue, parallelism);
   ```
   Can you help move this logic into `KuduSourceSplitEnumerator.open()`? Why need execute every time when registerReader() be called?


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] github-actions[bot] commented on pull request #2886: [Fix][Connector-V2] Fix Kudu Source redundant assignment

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2886:
URL: https://github.com/apache/incubator-seatunnel/pull/2886#issuecomment-1432280527

   This pull request has been closed because it has not had recent activity. You could reopen it if you try to continue your work, and anyone who are interested in it are encouraged to continue work on this pull request.


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] github-actions[bot] commented on pull request #2886: [Fix][Connector-V2] Fix Kudu Source redundant assignment

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2886:
URL: https://github.com/apache/incubator-seatunnel/pull/2886#issuecomment-1423416133

   This pull request has been automatically marked as stale because it has not had recent activity for 120 days. It will be closed in 7 days if no further activity occurs.


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] ashulin commented on a diff in pull request #2886: [Fix][Connector-V2] Fix Kudu Source redundant assignment

Posted by GitBox <gi...@apache.org>.
ashulin commented on code in PR #2886:
URL: https://github.com/apache/incubator-seatunnel/pull/2886#discussion_r980332284


##########
seatunnel-connectors-v2/connector-kudu/src/main/java/org/apache/seatunnel/connectors/seatunnel/kudu/source/KuduSourceSplitEnumerator.java:
##########
@@ -39,11 +40,19 @@ public class KuduSourceSplitEnumerator implements SourceSplitEnumerator<KuduSour
     public KuduSourceSplitEnumerator(SourceSplitEnumerator.Context<KuduSourceSplit> enumeratorContext, PartitionParameter partitionParameter) {
         this.enumeratorContext = enumeratorContext;
         this.partitionParameter = partitionParameter;
+        this.parallelism = enumeratorContext.currentParallelism();

Review Comment:
   Please do not save the value returned by `EnumeratorContext.currentParallelism()`



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] zhaomin1423 commented on pull request #2886: Fix redundant assignment

Posted by GitBox <gi...@apache.org>.
zhaomin1423 commented on PR #2886:
URL: https://github.com/apache/incubator-seatunnel/pull/2886#issuecomment-1257756179

   > ```java
   > Serializable[][] parameterValues = getParameterValues(partitionParameter.minValue, partitionParameter.maxValue, parallelism);
   > ```
   > 
   > Can you help move this logic into `KuduSourceSplitEnumerator.open()`? Why need execute every time when registerReader() be called?
   
   Good find, done.


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] ashulin commented on a diff in pull request #2886: [Fix][Connector-V2] Fix Kudu Source redundant assignment

Posted by GitBox <gi...@apache.org>.
ashulin commented on code in PR #2886:
URL: https://github.com/apache/incubator-seatunnel/pull/2886#discussion_r980328026


##########
seatunnel-connectors-v2/connector-kudu/src/main/java/org/apache/seatunnel/connectors/seatunnel/kudu/source/KuduSourceSplitEnumerator.java:
##########
@@ -39,11 +40,19 @@ public class KuduSourceSplitEnumerator implements SourceSplitEnumerator<KuduSour
     public KuduSourceSplitEnumerator(SourceSplitEnumerator.Context<KuduSourceSplit> enumeratorContext, PartitionParameter partitionParameter) {
         this.enumeratorContext = enumeratorContext;
         this.partitionParameter = partitionParameter;
+        this.parallelism = enumeratorContext.currentParallelism();

Review Comment:
   `EnumeratorContext.currentParallelism()` is Runtime Method, Use it in `SplitEnumerator#run()`



##########
seatunnel-connectors-v2/connector-kudu/src/main/java/org/apache/seatunnel/connectors/seatunnel/kudu/source/KuduSourceSplitEnumerator.java:
##########
@@ -39,11 +40,19 @@ public class KuduSourceSplitEnumerator implements SourceSplitEnumerator<KuduSour
     public KuduSourceSplitEnumerator(SourceSplitEnumerator.Context<KuduSourceSplit> enumeratorContext, PartitionParameter partitionParameter) {
         this.enumeratorContext = enumeratorContext;
         this.partitionParameter = partitionParameter;
+        this.parallelism = enumeratorContext.currentParallelism();
     }
 
     @Override
     public void open() {
-
+        if (null != partitionParameter) {
+            Serializable[][] parameterValues = getParameterValues(partitionParameter.minValue, partitionParameter.maxValue, parallelism);
+            for (int i = 0; i < parameterValues.length; i++) {
+                allSplit.add(new KuduSourceSplit(parameterValues[i], i));
+            }
+        } else {
+            allSplit.add(new KuduSourceSplit(null, 0));
+        }

Review Comment:
   Move it into #run()



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] zhaomin1423 commented on a diff in pull request #2886: [Fix][Connector-V2] Fix Kudu Source redundant assignment

Posted by GitBox <gi...@apache.org>.
zhaomin1423 commented on code in PR #2886:
URL: https://github.com/apache/incubator-seatunnel/pull/2886#discussion_r981844213


##########
seatunnel-connectors-v2/connector-kudu/src/main/java/org/apache/seatunnel/connectors/seatunnel/kudu/source/KuduSourceSplitEnumerator.java:
##########
@@ -39,11 +40,19 @@ public class KuduSourceSplitEnumerator implements SourceSplitEnumerator<KuduSour
     public KuduSourceSplitEnumerator(SourceSplitEnumerator.Context<KuduSourceSplit> enumeratorContext, PartitionParameter partitionParameter) {
         this.enumeratorContext = enumeratorContext;
         this.partitionParameter = partitionParameter;
+        this.parallelism = enumeratorContext.currentParallelism();

Review Comment:
   thanks, modify it later.



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] Hisoka-X commented on pull request #2886: Fix redundant assignment

Posted by GitBox <gi...@apache.org>.
Hisoka-X commented on PR #2886:
URL: https://github.com/apache/incubator-seatunnel/pull/2886#issuecomment-1257774078

   > > ```java
   > > Serializable[][] parameterValues = getParameterValues(partitionParameter.minValue, partitionParameter.maxValue, parallelism);
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > Can you help move this logic into `KuduSourceSplitEnumerator.open()`? Why need execute every time when registerReader() be called?
   > 
   > Good find, done.
   
   Great! Can you also help to add e2e? Refenerce: https://github.com/apache/incubator-seatunnel/tree/dev/seatunnel-e2e. 
   Thanks!


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] github-actions[bot] closed pull request #2886: [Fix][Connector-V2] Fix Kudu Source redundant assignment

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #2886: [Fix][Connector-V2] Fix Kudu Source redundant assignment
URL: https://github.com/apache/incubator-seatunnel/pull/2886


-- 
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: commits-unsubscribe@seatunnel.apache.org

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