healchow commented on code in PR #7289:
URL: https://github.com/apache/inlong/pull/7289#discussion_r1091391336
##########
inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/dirty/DirtySinkHelper.java:
##########
@@ -136,6 +185,51 @@ public void invokeMultiple(T dirtyData, DirtyType
dirtyType, Throwable e,
}
}
+ private String regexReplace(String pattern, DirtyType dirtyType,
+ String dirtyMessage, List<String> actualIdentifier) throws
IOException {
+
+ if (pattern == null) {
+ return null;
+ }
+
+ final Pattern REGEX_PATTERN =
Pattern.compile("\\$\\{\\s*([\\w.-]+)\\s*}", Pattern.CASE_INSENSITIVE);
Review Comment:
Suggest changing this regex pattern to a final static variable, or changing
the `regexReplace` method to static, which can improve the performance.
--
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]