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/03/09 06:29:28 UTC

[GitHub] [kafka] chia7712 opened a new pull request #10283: MINOR: KRPC supports to get true type from entity type

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


   Except for array type, the usage of `EntityType` is almost same to `type`. It makes our KRPC json file verbose. We can add a bit sugar to our KRPC that `EntityType` can be converted to true type in generated code.
   
   If this idea get approved, I will remove all redundant declaration from all json files.
   
   ### 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] dengziming commented on a change in pull request #10283: MINOR: KRPC supports to get true type from entity type

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



##########
File path: generator/src/main/java/org/apache/kafka/message/FieldSpec.java
##########
@@ -89,7 +89,12 @@ public FieldSpec(@JsonProperty("name") String name,
         }
         this.fields = Collections.unmodifiableList(fields == null ?
             Collections.emptyList() : new ArrayList<>(fields));
-        this.type = FieldType.parse(Objects.requireNonNull(type));
+        this.entityType = (entityType == null) ? EntityType.UNKNOWN : entityType;

Review comment:
       Type can be either "[]int32" or "int32" if the entityType is "brokerId", how to handle this problem?




----------------------------------------------------------------
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 #10283: MINOR: KRPC supports to get true type from entity type

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



##########
File path: generator/src/main/java/org/apache/kafka/message/FieldSpec.java
##########
@@ -89,7 +89,12 @@ public FieldSpec(@JsonProperty("name") String name,
         }
         this.fields = Collections.unmodifiableList(fields == null ?
             Collections.emptyList() : new ArrayList<>(fields));
-        this.type = FieldType.parse(Objects.requireNonNull(type));
+        this.entityType = (entityType == null) ? EntityType.UNKNOWN : entityType;

Review comment:
       Good question. This PR does not plan to support that cases as entity type can’t show “array” type. 




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