lujiajing1126 commented on code in PR #10448:
URL: https://github.com/apache/skywalking/pull/10448#discussion_r1174603337
##########
oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/BanyanDBAggregationQueryDAO.java:
##########
@@ -51,7 +52,53 @@ public BanyanDBAggregationQueryDAO(BanyanDBStorageClient
client) {
public List<SelectedRecord> sortMetrics(TopNCondition condition, String
valueColumnName, Duration duration, List<KeyValue> additionalConditions) throws
IOException {
final String modelName = condition.getName();
final TimestampRange timestampRange = new
TimestampRange(duration.getStartTimestamp(), duration.getEndTimestamp());
- MeasureQueryResponse resp = query(modelName, TAGS,
Collections.singleton(valueColumnName),
+ MetadataRegistry.Schema schema =
MetadataRegistry.INSTANCE.findMetadata(modelName, duration.getStep());
+ if (schema == null) {
+ throw new IOException("schema is not registered");
+ }
+
+ MetadataRegistry.ColumnSpec spec = schema.getSpec(valueColumnName);
+ if (spec == null) {
+ throw new IOException("field spec is not registered");
+ }
+
+ // BanyanDB server-side TopN support: for metrics aggregated at
instance, endpoint levels
+ if (schema.getTopNSpec() != null) {
+ return serverSideTopN(condition, schema, spec, timestampRange,
additionalConditions);
Review Comment:
Fixed
--
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]