wu-sheng commented on code in PR #10884:
URL: https://github.com/apache/skywalking/pull/10884#discussion_r1220538919


##########
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/group/EndpointNameGrouping.java:
##########
@@ -69,6 +113,40 @@ private String formatByOpenapi(String serviceName, String 
endpointName) {
                 log.trace("Endpoint {} of Service {} keeps unchanged.", 
endpointName, serviceName);
             }
         }
-        return formatResult.getName();
+        return new Tuple2<>(formatResult.getName(), formatResult.isMatch());
+    }
+
+    public void setHttpUriRecognitionSvr(final HttpUriRecognition 
httpUriRecognitionSvr) {
+        this.httpUriRecognitionSvr = httpUriRecognitionSvr;
+        Executors.newSingleThreadScheduledExecutor()
+                 .scheduleWithFixedDelay(
+                     new RunnableWithExceptionProtection(
+                         () -> {
+                             cachedHttpUris.forEach((serviceName, httpUris) -> 
{
+                                 List<HttpUriRecognition.HTTPUri> uris
+                                     = httpUris.keySet()
+                                               .stream()
+                                               .map(
+                                                   uri -> new 
HttpUriRecognition.HTTPUri(
+                                                       uri, 
httpUris.get(uri).get()
+                                                   ))
+                                               .collect(Collectors.toList());
+                                 // Reset the cache once the URIs are sent to 
the recognition server.
+                                 httpUris.clear();
+                                 httpUriRecognitionSvr
+                                     .recognize(serviceName, uris,
+                                                (service, patterns) -> {
+                                                    StringFormatGroup group = 
new StringFormatGroup(patterns.size());
+                                                    patterns.forEach(
+                                                        p -> 
group.addRule(p.getFormattedUri(), p.getPattern()));

Review Comment:
   Yes, it works for future URIs only. It is a regression rather than a 
re-procession. What had been done is done, we would not retrieve the data from 
the database and update it all, that would be a disaster. 



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

Reply via email to