wu-sheng commented on a change in pull request #5202:
URL: https://github.com/apache/skywalking/pull/5202#discussion_r466752620



##########
File path: 
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/query/IMetricsQueryDAO.java
##########
@@ -76,5 +87,54 @@ public static IntValues sortValues(IntValues origin, 
List<String> expectedOrder,
             }
             return origin;
         }
+
+        /**
+         * Compose the multiple metric result based on conditions.
+         */
+        public static List<MetricsValues> composeLabelValue(final 
MetricsCondition condition,
+            final List<String> labels,
+            final List<String> ids,
+            final Map<String, DataTable> idMap) {
+            List<String> allLabels;
+            if (Objects.isNull(labels) || labels.size() < 1) {
+                allLabels = idMap.values().stream()
+                    .flatMap(dataTable -> dataTable.keys().stream())
+                    .distinct().collect(Collectors.toList());
+            } else {
+                allLabels = labels;
+            }
+            final int defaultValue = 
ValueColumnMetadata.INSTANCE.getDefaultValue(condition.getName());
+            List<LabeledValue> labeledValues = 
Sets.newTreeSet(allLabels).stream()

Review comment:
       According this the documents, this `#newTreeSet` is **deprecated**
   
   ```
      * <p><b>Note for Java 7 and later:</b> this method is now unnecessary and 
should be treated as
      * deprecated. Instead, use the {@code TreeSet} constructor directly, 
taking advantage of the new
      * <a href="http://goo.gl/iz2Wi";>"diamond" syntax</a>.
   ```




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to