-
Notifications
You must be signed in to change notification settings - Fork 14.4k
KAFKA-10769 Remove JoinGroupRequest#containsValidPattern as it is dup… #9851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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! |
/** | ||
* Ported from class Topic in {@link org.apache.kafka.common.internals} to restrict the charset for | ||
* static member id. | ||
*/ | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified code thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @chia7712
thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the following check have similar issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chia7712
Would it be okay to explain a little more about what follow check means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for unclear comment :(
My point was error type thrown by following checks was changed also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chia7712
thanks
I modified code!
I think everything will be fine if I modify it like this. How about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @chia7712
thanks!
ping @chia7712 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@highluck thanks for updating code. please take a look at following comments. thanks!
@@ -64,7 +65,7 @@ public void shouldRecognizeInvalidCharactersInGroupInstanceIds() { | |||
|
|||
for (char c : invalidChars) { | |||
String instanceId = "Is " + c + "illegal"; | |||
assertFalse(JoinGroupRequest.containsValidPattern(instanceId)); | |||
assertFalse(Topic.containsValidPattern(instanceId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -74,7 +81,7 @@ public static boolean hasCollision(String topicA, String topicB) { | |||
/** | |||
* 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@highluck thanks for updating code. one last comment is left. Please fix it and then I will merge this patch.
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove those indents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chia7712
thanks i updated code
* 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)