poorbarcode commented on code in PR #21885:
URL: https://github.com/apache/pulsar/pull/21885#discussion_r1452256094
##########
pulsar-common/src/main/java/org/apache/pulsar/common/topics/TopicList.java:
##########
@@ -47,13 +47,16 @@ public static List<String> filterTopics(List<String>
original, String regex) {
}
public static List<String> filterTopics(List<String> original, Pattern
topicsPattern) {
- final Pattern shortenedTopicsPattern =
topicsPattern.toString().contains(SCHEME_SEPARATOR)
- ?
Pattern.compile(SCHEME_SEPARATOR_PATTERN.split(topicsPattern.toString())[1]) :
topicsPattern;
+ final Pattern shortenedTopicsPattern =
Pattern.compile(removeTopicDomainSchema(topicsPattern.toString()));
return original.stream()
.map(TopicName::get)
+ .filter(topicName -> {
+ String partitionedTopicName =
topicName.getPartitionedTopicName();
+ String removedSchema =
SCHEME_SEPARATOR_PATTERN.split(partitionedTopicName)[1];
Review Comment:
Renamed
##########
pulsar-common/src/main/java/org/apache/pulsar/common/topics/TopicList.java:
##########
@@ -78,4 +81,16 @@ public static Set<String> minus(Collection<String> list1,
Collection<String> lis
s1.removeAll(list2);
return s1;
}
+
+ private static String removeTopicDomainSchema(String originalRegexp) {
Review Comment:
Renamed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]