hanahmily commented on code in PR #10448:
URL: https://github.com/apache/skywalking/pull/10448#discussion_r1119436555


##########
oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/BanyanDBAggregationQueryDAO.java:
##########
@@ -85,24 +60,45 @@ protected void apply(MeasureQuery query) {
             throw new IOException("field spec is not registered");
         }
 
+        if (schema.getTopNSpec() == null) {
+            throw new IOException("TopN spec is registered");
+        }
+
+        TopNQueryResponse resp = null;
+        if (condition.getOrder() == Order.DES) {
+            resp = topN(schema, timestampRange, condition.getTopN(), 
additionalConditions);
+        } else {
+            resp = bottomN(schema, timestampRange, condition.getTopN(), 
additionalConditions);
+        }

Review Comment:
   > > Let's say there are 200 services, each service has 50k endpoints, we 
need both service-based topN endpoints and global level topN endpoints. How do 
we make this work? If we only set the rule as top 1000, which are all belonging 
to several services. This means we can't have topN for other services.
   > 
   > > 
   > 
   > > @lujiajing1126 @hanahmily What are your suggestions for this real case?
   > 
   > 
   > 
   > Yes. It is possible. Even two TopN(s) or more cannot help in this case.
   
   From the server’s perspective, we can set a global endpoint topn process and 
several sub-endpoints top with a service id to support this scenario. 
@lujiajing1126 What’s the gap here?



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