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


##########
oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/rt/OALRuntime.java:
##########
@@ -315,6 +326,30 @@ private Class generateMetricsClass(AnalysisResult 
metricsStmt) throws OALCompile
         streamAnnotation.addMemberValue("processor", new 
ClassMemberValue(METRICS_STREAM_PROCESSOR, constPool));
 
         annotationsAttribute.addAnnotation(streamAnnotation);
+
+        // Add @BanyanDB.TopNAggregation if applicable
+        // 1. groupByTagName is not empty
+        // 2. parentClass implements LongValueHolder, IntValueHolder or 
DoubleValueHolder
+        try {
+            if (Arrays.stream(parentMetricsClass.getInterfaces())
+                    .anyMatch(i -> i.getSimpleName().equals("IntValueHolder") 
||
+                            i.getSimpleName().equals("LongValueHolder") ||
+                            i.getSimpleName().equals("DoubleValueHolder"))) {

Review Comment:
   I think `isAssignableFrom` is a better way.



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