KAFKA-10769 Remove JoinGroupRequest#containsValidPattern as it is dup…#9851
KAFKA-10769 Remove JoinGroupRequest#containsValidPattern as it is dup…#9851chia7712 merged 12 commits intoapache:trunkfrom
Conversation
…licate to Topic#containsValidPattern
|
@chia7712 |
|
@highluck Thanks for your patch. The check of static group id (https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/requests/JoinGroupRequest.java#L68) is almost same to check in Should we remove the duplicate also? WDYT? |
|
@abbccdda Could we reuse the code (https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/internals/Topic.java#L36) to do the validation for static member id? Please correct me if there is any concern. Thanks! |
| */ | ||
| public static void validateGroupInstanceId(String id) { | ||
| if (id.equals("")) | ||
| throw new InvalidConfigurationException("Group instance id must be non-empty string"); |
There was a problem hiding this comment.
The exception is changed from InvalidConfigurationException to InvalidTopicException. It results in different Errors so I feel it would be better to keep throwing InvalidConfigurationException for this check
There was a problem hiding this comment.
I modified code thanks!
There was a problem hiding this comment.
the following check have similar issue.
There was a problem hiding this comment.
@chia7712
Would it be okay to explain a little more about what follow check means?
There was a problem hiding this comment.
sorry for unclear comment :(
My point was error type thrown by following checks was changed also.
There was a problem hiding this comment.
@chia7712
thanks
I modified code!
I think everything will be fine if I modify it like this. How about?
|
ping @chia7712 |
| for (char c : invalidChars) { | ||
| String instanceId = "Is " + c + "illegal"; | ||
| assertFalse(JoinGroupRequest.containsValidPattern(instanceId)); | ||
| assertFalse(Topic.containsValidPattern(instanceId)); |
There was a problem hiding this comment.
This test case is duplicate to https://github.com/apache/kafka/blob/trunk/clients/src/test/java/org/apache/kafka/common/internals/TopicTest.java#L65. I feel it is fine to remove it.
| * Valid characters for Kafka topics are the ASCII alphanumerics, '.', '_', and '-' | ||
| */ | ||
| static boolean containsValidPattern(String topic) { | ||
| public static boolean containsValidPattern(String topic) { |
There was a problem hiding this comment.
This change is unnecessary if we remove the duplicate test case.
|
ping @chia7712 |
|
@highluck Could you merge trunk to trigger QA again? It seems our jenkins was on vacation before :) |
|
@chia7712 There seems to be some hung builds. Shall we merge again? |
|
yep, please merge trunk. Thanks! |
|
@chia7712 There seems to be some test fail. |
| } | ||
| } | ||
|
|
||
|
|
* apache-github/trunk: KAFKA-10769 Remove JoinGroupRequest#containsValidPattern as it is dup… (apache#9851) KAFKA-12384: stabilize ListOffsetsRequestTest#testResponseIncludesLeaderEpoch (apache#10389) KAFKA-5146: remove Connect dependency from Streams module (apache#10131)
https://issues.apache.org/jira/browse/KAFKA-10769
.cc @chia7712
Committer Checklist (excluded from commit message)