This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch uri-svr
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit 0bf1cd13d1e6e98cf8020d6944d27fb77d4a6e82
Author: Wu Sheng <[email protected]>
AuthorDate: Tue Jun 20 09:06:26 2023 +0800

    [Breaking change] Remove `matchedCounter` from 
`HttpUriRecognitionService#feedRawData`.
---
 docs/en/changes/changes.md                             |  1 +
 .../pipeline/services/HttpUriRecognitionService.java   |  2 +-
 .../ai/pipeline/services/api/HttpUriRecognition.java   |  1 -
 .../src/main/proto/ai_http_uri_recognition.proto       |  1 -
 .../server/core/config/group/EndpointNameGrouping.java | 18 +++++-------------
 5 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md
index aa76893093..8f4d32d589 100644
--- a/docs/en/changes/changes.md
+++ b/docs/en/changes/changes.md
@@ -9,6 +9,7 @@
 * Add Neo4j component ID(112) language: Python.
 * Add Istio ServiceEntry registry to resolve unknown IPs in ALS.
 * Improve Kubernetes coordinator to only select ready OAP Pods to build 
cluster.
+* [Breaking change] Remove `matchedCounter` from 
`HttpUriRecognitionService#feedRawData`.
 
 #### UI
 
diff --git 
a/oap-server/ai-pipeline/src/main/java/org/apache/skywalking/oap/server/ai/pipeline/services/HttpUriRecognitionService.java
 
b/oap-server/ai-pipeline/src/main/java/org/apache/skywalking/oap/server/ai/pipeline/services/HttpUriRecognitionService.java
index 66d5e5bfe8..51a59821d7 100644
--- 
a/oap-server/ai-pipeline/src/main/java/org/apache/skywalking/oap/server/ai/pipeline/services/HttpUriRecognitionService.java
+++ 
b/oap-server/ai-pipeline/src/main/java/org/apache/skywalking/oap/server/ai/pipeline/services/HttpUriRecognitionService.java
@@ -93,7 +93,7 @@ public class HttpUriRecognitionService implements 
HttpUriRecognition {
             builder.setService(service);
             unrecognizedURIs.forEach(httpUri -> {
                 builder.getUnrecognizedUrisBuilderList().add(
-                    
HttpRawUri.newBuilder().setName(httpUri.getName()).setMatchedCounter(httpUri.getMatchedCounter())
+                    HttpRawUri.newBuilder().setName(httpUri.getName())
                 );
             });
             stub.withDeadlineAfter(30, TimeUnit.SECONDS)
diff --git 
a/oap-server/ai-pipeline/src/main/java/org/apache/skywalking/oap/server/ai/pipeline/services/api/HttpUriRecognition.java
 
b/oap-server/ai-pipeline/src/main/java/org/apache/skywalking/oap/server/ai/pipeline/services/api/HttpUriRecognition.java
index 51d299ccb9..572aac01be 100644
--- 
a/oap-server/ai-pipeline/src/main/java/org/apache/skywalking/oap/server/ai/pipeline/services/api/HttpUriRecognition.java
+++ 
b/oap-server/ai-pipeline/src/main/java/org/apache/skywalking/oap/server/ai/pipeline/services/api/HttpUriRecognition.java
@@ -52,6 +52,5 @@ public interface HttpUriRecognition extends Service {
     @Getter
     class HTTPUri {
         private final String name;
-        private final long matchedCounter;
     }
 }
diff --git 
a/oap-server/ai-pipeline/src/main/proto/ai_http_uri_recognition.proto 
b/oap-server/ai-pipeline/src/main/proto/ai_http_uri_recognition.proto
index f5cb57eb30..b03e7e7323 100644
--- a/oap-server/ai-pipeline/src/main/proto/ai_http_uri_recognition.proto
+++ b/oap-server/ai-pipeline/src/main/proto/ai_http_uri_recognition.proto
@@ -44,7 +44,6 @@ message HttpUriRecognitionRequest {
 
 message HttpRawUri {
     string name = 1;
-    int64 matchedCounter = 2;
 }
 
 message HttpUriRecognitionResponse {
diff --git 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/group/EndpointNameGrouping.java
 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/group/EndpointNameGrouping.java
index abbb51d8e2..ca5af6068e 100644
--- 
a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/group/EndpointNameGrouping.java
+++ 
b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/config/group/EndpointNameGrouping.java
@@ -56,12 +56,9 @@ public class EndpointNameGrouping {
     private volatile QuickUriGroupingRule quickUriGroupingRule;
     /**
      * Cache the HTTP URIs which are not formatted by the rules per service.
-     * Level one map key is service name, the value is a map of HTTP URI and 
its count.
-     * Multiple matches will be counted, because it is the pattern that the 
endpoint is already formatted,
-     * or doesn't need to be formatted.
-     * The repeatable URI is a pattern already.
+     * Level one map key is service name, the value is a map of HTTP URIs with 
an always TRUE value.
      */
-    private ConcurrentHashMap<String, ConcurrentHashMap<String, 
AtomicInteger>> cachedHttpUris = new ConcurrentHashMap<>();
+    private ConcurrentHashMap<String, ConcurrentHashMap<String, Boolean>> 
cachedHttpUris = new ConcurrentHashMap<>();
     private final AtomicInteger aiPipelineExecutionCounter = new 
AtomicInteger(0);
     /**
      * The max number of HTTP URIs per service for further URI pattern 
recognition.
@@ -90,17 +87,14 @@ public class EndpointNameGrouping {
         if (!formattedName._2() && quickUriGroupingRule != null) {
             formattedName = formatByQuickUriPattern(serviceName, endpointName);
 
-            ConcurrentHashMap<String, AtomicInteger> svrHttpUris = 
cachedHttpUris.get(serviceName);
+            ConcurrentHashMap<String, Boolean> svrHttpUris = 
cachedHttpUris.get(serviceName);
             if (svrHttpUris == null) {
                 cachedHttpUris.putIfAbsent(serviceName, new 
ConcurrentHashMap<>());
                 svrHttpUris = cachedHttpUris.get(serviceName);
             }
             // Only cache first N(determined by maxHttpUrisNumberPerService) 
URIs per 30 mins.
             if (svrHttpUris.size() < maxHttpUrisNumberPerService) {
-                final AtomicInteger cachedCount = 
svrHttpUris.putIfAbsent(formattedName._1(), new AtomicInteger(1));
-                if (null != cachedCount) {
-                    cachedCount.incrementAndGet();
-                }
+                svrHttpUris.putIfAbsent(formattedName._1(), Boolean.TRUE);
             }
         }
 
@@ -170,9 +164,7 @@ public class EndpointNameGrouping {
                                          = httpUris.keySet()
                                                    .stream()
                                                    .map(
-                                                       uri -> new 
HttpUriRecognition.HTTPUri(
-                                                           uri, 
httpUris.get(uri).get()
-                                                       ))
+                                                       
HttpUriRecognition.HTTPUri::new)
                                                    
.collect(Collectors.toList());
                                      // Reset the cache once the URIs are sent 
to the recognition server.
                                      httpUris.clear();

Reply via email to