hanahmily commented on a change in pull request #4:
URL: 
https://github.com/apache/skywalking-banyandb-java-client/pull/4#discussion_r750025152



##########
File path: 
src/main/java/org/apache/skywalking/banyandb/v1/client/metadata/Measure.java
##########
@@ -0,0 +1,438 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.banyandb.v1.client.metadata;
+
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
+import org.apache.skywalking.banyandb.database.v1.metadata.BanyandbMetadata;
+import org.apache.skywalking.banyandb.v1.client.util.TimeUtils;
+
+import java.time.ZonedDateTime;
+import java.util.ArrayList;
+import java.util.List;
+
+@Setter
+@Getter
+@EqualsAndHashCode(callSuper = true)
+public class Measure extends NamedSchema<BanyandbMetadata.Measure> {
+    /**
+     * specs of tag families
+     */
+    private List<TagFamilySpec> tagFamilySpecs;
+
+    /**
+     * fieldSpecs denote measure values
+     */
+    private List<FieldSpec> fieldSpecs;
+
+    /**
+     * tag names used to generate an entity
+     */
+    private List<String> entityTagNames;
+
+    /**
+     * intervalRules define data points writing interval
+     */
+    private List<IntervalRule<?>> intervalRules;
+
+    /**
+     * number of shards
+     */
+    private int shardNum;
+
+    /**
+     * duration determines how long a Stream keeps its data
+     */
+    private Duration ttl;
+
+    public Measure(String name, int shardNum, Duration ttl) {
+        this(name, shardNum, ttl, null);
+    }
+
+    private Measure(String name, int shardNum, Duration ttl, ZonedDateTime 
updatedAt) {
+        super(name, updatedAt);
+        this.tagFamilySpecs = new ArrayList<>();
+        this.entityTagNames = new ArrayList<>();
+        this.fieldSpecs = new ArrayList<>();
+        this.intervalRules = new ArrayList<>();
+        this.shardNum = shardNum;
+        this.ttl = ttl;
+    }
+
+    /**
+     * Add a tag name as a part of the entity
+     *
+     * @param name the name of the tag
+     */
+    public Measure addTagNameAsEntity(String name) {
+        this.entityTagNames.add(name);
+        return this;
+    }
+
+    /**
+     * Add a tag family spec to the schema
+     *
+     * @param tagFamilySpec a tag family containing tag specs
+     */
+    public Measure addTagFamilySpec(TagFamilySpec tagFamilySpec) {
+        this.tagFamilySpecs.add(tagFamilySpec);
+        return this;
+    }
+
+    /**
+     * Add an interval rule to the schema
+     *
+     * @param intervalRule an interval rule to match tag name and value
+     */
+    public Measure addIntervalRule(IntervalRule<?> intervalRule) {

Review comment:
       @lujiajing1126 Would you pls link this doc here. I will polish it in the 
future. 




-- 
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-unsubscr...@skywalking.apache.org

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


Reply via email to