You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by "jjbiggins (via GitHub)" <gi...@apache.org> on 2023/02/14 00:40:03 UTC

[GitHub] [incubator-eventmesh] jjbiggins opened a new pull request, #3135: Enhancement Request: [Enhancement] Actual value of parameter 'length…

jjbiggins opened a new pull request, #3135:
URL: https://github.com/apache/incubator-eventmesh/pull/3135

   …' is always 'MessageUtils.SEQ_LENGTH' #3096
   
   <!--
   ### Contribution Checklist
   
     - Name the pull request in the form "[ISSUE #3096] Title of the pull request", 
       where *3096* should be replaced by the actual issue number.
       Skip *[ISSUE #3096]* if there is no associated github issue for this pull request.
   
     - 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.
     
     - Each pull request should address only one issue. 
       Please do not mix up code from multiple issues.
     
     - Each commit in the pull request should have a meaningful commit message.
   
     - 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)
   -->
   
   <!--
   (If this PR fixes a GitHub issue, please add `Fixes #<3096>` or `Cloese #<XXX>`.)
   -->
   
   Fixes #<3096>.
   
   ### Motivation
   
   *Explain the content here.*
   Requested Enhancement
   
   *Explain why you want to make the changes and what problem you're trying to solve.*
   Contribute to requested enhancement for MessageUtils.getRandomString() method.
   
   
   
   
   ### Modifications
   
   *Describe the modifications you've done.*
   Changed method signature to take zero arguments; then, updated the private getRandomString calls used throughout the MessageUtils class' various other methods.
   
   
   ### Documentation
   
   - Does this pull request introduce a new feature? (yes / no) No
   - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented) N/A
   - If a feature is not applicable for documentation, explain why? N/A
   - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] jjbiggins commented on a diff in pull request #3135: [ISSUE #3096] Actual value of parameter 'length' is always 'MessageUtils.SEQ_LENGTH'

Posted by "jjbiggins (via GitHub)" <gi...@apache.org>.
jjbiggins commented on code in PR #3135:
URL: https://github.com/apache/incubator-eventmesh/pull/3135#discussion_r1106529350


##########
eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/common/MessageUtils.java:
##########
@@ -91,14 +86,14 @@ public static Package asyncMessageAck(Package in) {
 
     public static Package buildPackage(Object message, Command command) {
         final Package msg = new Package();
-        msg.setHeader(new Header(command, 0, null, generateRandomString(SEQ_LENGTH)));
+        msg.setHeader(new Header(command, 0, null, generateRandomString()));
         if (message instanceof CloudEvent) {
             final CloudEvent cloudEvent = (CloudEvent) message;
-            Preconditions.checkNotNull(cloudEvent.getDataContentType(), "DateContentType cannot be null");
+            Preconditions.checkNotNull(Objects.requireNonNull(cloudEvent.getDataContentType()), "DateContentType cannot be null");

Review Comment:
   Removed duplicated not null check



-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] xwm1992 merged pull request #3135: [ISSUE #3096] Actual value of parameter 'length' is always 'MessageUtils.SEQ_LENGTH'

Posted by "xwm1992 (via GitHub)" <gi...@apache.org>.
xwm1992 merged PR #3135:
URL: https://github.com/apache/incubator-eventmesh/pull/3135


-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] mytang0 commented on a diff in pull request #3135: [ISSUE #3096] Actual value of parameter 'length' is always 'MessageUtils.SEQ_LENGTH'

Posted by "mytang0 (via GitHub)" <gi...@apache.org>.
mytang0 commented on code in PR #3135:
URL: https://github.com/apache/incubator-eventmesh/pull/3135#discussion_r1106031485


##########
eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/common/MessageUtils.java:
##########
@@ -17,68 +17,63 @@
 
 package org.apache.eventmesh.client.tcp.common;
 
+import io.cloudevents.CloudEvent;
+import io.cloudevents.SpecVersion;
+import io.cloudevents.core.provider.EventFormatProvider;
+import io.openmessaging.api.Message;
 import org.apache.eventmesh.common.Constants;
 import org.apache.eventmesh.common.protocol.SubscriptionItem;
 import org.apache.eventmesh.common.protocol.SubscriptionMode;
 import org.apache.eventmesh.common.protocol.SubscriptionType;
-import org.apache.eventmesh.common.protocol.tcp.Command;
-import org.apache.eventmesh.common.protocol.tcp.EventMeshMessage;
-import org.apache.eventmesh.common.protocol.tcp.Header;
 import org.apache.eventmesh.common.protocol.tcp.Package;
-import org.apache.eventmesh.common.protocol.tcp.Subscription;
-import org.apache.eventmesh.common.protocol.tcp.UserAgent;
+import org.apache.eventmesh.common.protocol.tcp.*;

Review Comment:
   Please fix the checkStyle bug, do not import '.*'



-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] jjbiggins commented on a diff in pull request #3135: [ISSUE #3096] Actual value of parameter 'length' is always 'MessageUtils.SEQ_LENGTH'

Posted by "jjbiggins (via GitHub)" <gi...@apache.org>.
jjbiggins commented on code in PR #3135:
URL: https://github.com/apache/incubator-eventmesh/pull/3135#discussion_r1106529254


##########
eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/common/MessageUtils.java:
##########
@@ -17,68 +17,63 @@
 
 package org.apache.eventmesh.client.tcp.common;
 
+import io.cloudevents.CloudEvent;
+import io.cloudevents.SpecVersion;
+import io.cloudevents.core.provider.EventFormatProvider;
+import io.openmessaging.api.Message;
 import org.apache.eventmesh.common.Constants;
 import org.apache.eventmesh.common.protocol.SubscriptionItem;
 import org.apache.eventmesh.common.protocol.SubscriptionMode;
 import org.apache.eventmesh.common.protocol.SubscriptionType;
-import org.apache.eventmesh.common.protocol.tcp.Command;
-import org.apache.eventmesh.common.protocol.tcp.EventMeshMessage;
-import org.apache.eventmesh.common.protocol.tcp.Header;
 import org.apache.eventmesh.common.protocol.tcp.Package;
-import org.apache.eventmesh.common.protocol.tcp.Subscription;
-import org.apache.eventmesh.common.protocol.tcp.UserAgent;
+import org.apache.eventmesh.common.protocol.tcp.*;

Review Comment:
   I must've had my IDE set to optimize imports; I corrected this, and commit.



-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] mytang0 commented on a diff in pull request #3135: [ISSUE #3096] Actual value of parameter 'length' is always 'MessageUtils.SEQ_LENGTH'

Posted by "mytang0 (via GitHub)" <gi...@apache.org>.
mytang0 commented on code in PR #3135:
URL: https://github.com/apache/incubator-eventmesh/pull/3135#discussion_r1106037641


##########
eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/tcp/common/MessageUtils.java:
##########
@@ -91,14 +86,14 @@ public static Package asyncMessageAck(Package in) {
 
     public static Package buildPackage(Object message, Command command) {
         final Package msg = new Package();
-        msg.setHeader(new Header(command, 0, null, generateRandomString(SEQ_LENGTH)));
+        msg.setHeader(new Header(command, 0, null, generateRandomString()));
         if (message instanceof CloudEvent) {
             final CloudEvent cloudEvent = (CloudEvent) message;
-            Preconditions.checkNotNull(cloudEvent.getDataContentType(), "DateContentType cannot be null");
+            Preconditions.checkNotNull(Objects.requireNonNull(cloudEvent.getDataContentType()), "DateContentType cannot be null");

Review Comment:
   Isn't the non-null check repeated?



-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] codecov[bot] commented on pull request #3135: [ISSUE #3096] Actual value of parameter 'length' is always 'MessageUtils.SEQ_LENGTH'

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #3135:
URL: https://github.com/apache/incubator-eventmesh/pull/3135#issuecomment-1430671393

   # [Codecov](https://codecov.io/gh/apache/incubator-eventmesh/pull/3135?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#3135](https://codecov.io/gh/apache/incubator-eventmesh/pull/3135?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6592b45) into [master](https://codecov.io/gh/apache/incubator-eventmesh/commit/e4f2355eef5325fb5b128f45869399763d26f2fb?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e4f2355) will **decrease** coverage by `0.01%`.
   > The diff coverage is `27.27%`.
   
   > :exclamation: Current head 6592b45 differs from pull request most recent head 79f119c. Consider uploading reports for the commit 79f119c to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3135      +/-   ##
   ============================================
   - Coverage     13.10%   13.10%   -0.01%     
     Complexity     1145     1145              
   ============================================
     Files           548      548              
     Lines         28624    28618       -6     
     Branches       2861     2849      -12     
   ============================================
   - Hits           3751     3749       -2     
   + Misses        24550    24548       -2     
   + Partials        323      321       -2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-eventmesh/pull/3135?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...e/eventmesh/protocol/http/HttpProtocolAdaptor.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3135?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXByb3RvY29sLXBsdWdpbi9ldmVudG1lc2gtcHJvdG9jb2wtaHR0cC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL3Byb3RvY29sL2h0dHAvSHR0cFByb3RvY29sQWRhcHRvci5qYXZh) | `5.26% <0.00%> (-0.30%)` | :arrow_down: |
   | [.../runtime/core/protocol/http/retry/HttpRetryer.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3135?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2NvcmUvcHJvdG9jb2wvaHR0cC9yZXRyeS9IdHRwUmV0cnllci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...ache/eventmesh/client/tcp/common/MessageUtils.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3135?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXNkay1qYXZhL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ldmVudG1lc2gvY2xpZW50L3RjcC9jb21tb24vTWVzc2FnZVV0aWxzLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...ry/zookeeper/service/ZookeeperRegistryService.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3135?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJlZ2lzdHJ5LXBsdWdpbi9ldmVudG1lc2gtcmVnaXN0cnktem9va2VlcGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ldmVudG1lc2gvcmVnaXN0cnkvem9va2VlcGVyL3NlcnZpY2UvWm9va2VlcGVyUmVnaXN0cnlTZXJ2aWNlLmphdmE=) | `77.77% <100.00%> (+0.44%)` | :arrow_up: |
   | [...ventmesh/client/grpc/util/EventMeshClientUtil.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3135?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXNkay1qYXZhL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ldmVudG1lc2gvY2xpZW50L2dycGMvdXRpbC9FdmVudE1lc2hDbGllbnRVdGlsLmphdmE=) | `91.20% <0.00%> (-0.34%)` | :arrow_down: |
   | [...rg/apache/eventmesh/runtime/trace/LogExporter.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3135?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL3RyYWNlL0xvZ0V4cG9ydGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...ime/admin/handler/RedirectClientByPathHandler.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3135?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2hhbmRsZXIvUmVkaXJlY3RDbGllbnRCeVBhdGhIYW5kbGVyLmphdmE=) | `84.78% <0.00%> (ø)` | |
   | [...e/admin/handler/RedirectClientByIpPortHandler.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3135?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2hhbmRsZXIvUmVkaXJlY3RDbGllbnRCeUlwUG9ydEhhbmRsZXIuamF2YQ==) | `31.37% <0.00%> (ø)` | |
   | [.../tcp/client/session/push/DownStreamMsgContext.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3135?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2NvcmUvcHJvdG9jb2wvdGNwL2NsaWVudC9zZXNzaW9uL3B1c2gvRG93blN0cmVhbU1zZ0NvbnRleHQuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...l/tcp/client/recommend/EventMeshRecommendImpl.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3135?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2NvcmUvcHJvdG9jb2wvdGNwL2NsaWVudC9yZWNvbW1lbmQvRXZlbnRNZXNoUmVjb21tZW5kSW1wbC5qYXZh) | `0.83% <0.00%> (+<0.01%)` | :arrow_up: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org