You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/11/02 04:12:02 UTC

[GitHub] [skywalking] hanahmily commented on a diff in pull request #9839: Update BanyanDB storage module to adapt BanyanDB 0.2

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


##########
oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/MetadataRegistry.java:
##########
@@ -293,21 +335,41 @@ public SchemaMetadata parseMetadata(Model model, BanyanDBStorageConfig config) {
     @Data
     public static class SchemaMetadata {
         private final String group;
-        private final String name;
+        /**
+         * name of the {@link Model}
+         */
+        private final String modelName;
         private final Kind kind;
-
+        /**
+         * down-sampling of the {@link Model}
+         */
+        private final DownSampling downSampling;
         private final int shard;
         private final int blockIntervalHrs;
         private final int segmentIntervalHrs;
         private final int ttlDays;
 
+        /**
+         * Format the entity name for BanyanDB
+         *
+         * @param modelName    name of the model
+         * @param downSampling not used if it is {@link DownSampling#None}
+         * @return entity (e.g. measure, stream) name
+         */
+        static String formatName(String modelName, DownSampling downSampling) {
+            if (downSampling == null || downSampling == DownSampling.None) {
+                return modelName;
+            }
+            return modelName + ":" + downSampling.getName();

Review Comment:
   Underscore "_"  is better and compatible with the metric name's convention.



-- 
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: notifications-unsubscribe@skywalking.apache.org

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