You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/02/10 15:56:38 UTC

[GitHub] [kafka] chia7712 opened a new pull request #10098: KAFKA-12321 the comparison function for uuid type should be 'equals' …

chia7712 opened a new pull request #10098:
URL: https://github.com/apache/kafka/pull/10098


   issue: https://issues.apache.org/jira/browse/KAFKA-12321
   
   ### current comparison
   ```java
   if (this.taggedUuid != Uuid.fromString("H3KKO4NTRPaCWtEmm3vW7A"))
   ```
   
   ### fixed comparison
   ```java
   if (!this.taggedUuid.equals(Uuid.fromString("H3KKO4NTRPaCWtEmm3vW7A")))
   ```
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


----------------------------------------------------------------
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] [kafka] chia7712 merged pull request #10098: KAFKA-12321 the comparison function for uuid type should be 'equals' …

Posted by GitBox <gi...@apache.org>.
chia7712 merged pull request #10098:
URL: https://github.com/apache/kafka/pull/10098


   


----------------------------------------------------------------
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] [kafka] chia7712 commented on pull request #10098: KAFKA-12321 the comparison function for uuid type should be 'equals' …

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #10098:
URL: https://github.com/apache/kafka/pull/10098#issuecomment-778324758


   push to trunk, 2.8, 2.7 and 2.6


----------------------------------------------------------------
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] [kafka] ijuma commented on a change in pull request #10098: KAFKA-12321 the comparison function for uuid type should be 'equals' …

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #10098:
URL: https://github.com/apache/kafka/pull/10098#discussion_r575300923



##########
File path: clients/src/test/java/org/apache/kafka/common/message/MessageTest.java
##########
@@ -749,6 +750,13 @@ public void testProduceResponseVersions() throws Exception {
         }
     }
 
+    @Test
+    public void defaultValueShouldBeWritable() {
+        for (short version = SimpleExampleMessageData.LOWEST_SUPPORTED_VERSION; version <= SimpleExampleMessageData.HIGHEST_SUPPORTED_VERSION; ++version) {
+            MessageUtil.toByteBuffer(new SimpleExampleMessageData(), version);

Review comment:
       This fails without the change in this PR?




----------------------------------------------------------------
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] [kafka] chia7712 commented on a change in pull request #10098: KAFKA-12321 the comparison function for uuid type should be 'equals' …

Posted by GitBox <gi...@apache.org>.
chia7712 commented on a change in pull request #10098:
URL: https://github.com/apache/kafka/pull/10098#discussion_r575307669



##########
File path: clients/src/test/java/org/apache/kafka/common/message/MessageTest.java
##########
@@ -749,6 +750,13 @@ public void testProduceResponseVersions() throws Exception {
         }
     }
 
+    @Test
+    public void defaultValueShouldBeWritable() {
+        for (short version = SimpleExampleMessageData.LOWEST_SUPPORTED_VERSION; version <= SimpleExampleMessageData.HIGHEST_SUPPORTED_VERSION; ++version) {
+            MessageUtil.toByteBuffer(new SimpleExampleMessageData(), version);

Review comment:
       > This fails without the change in this PR?
   
   yep. The generated code is shown below.
   ```java
               if (this.taggedUuid != Uuid.fromString("H3KKO4NTRPaCWtEmm3vW7A")) {
                   throw new UnsupportedVersionException("Attempted to write a non-default taggedUuid at version " + _version);
               }
   ```




----------------------------------------------------------------
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