You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2025/02/26 01:28:47 UTC

(skywalking-banyandb) 01/01: Add LifecycleStage

This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch lm-api
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git

commit d07c370e7ab2be9135b7957aad490bafd951bcfb
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Wed Feb 26 09:28:15 2025 +0800

    Add LifecycleStage
    
    Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
 api/proto/banyandb/common/v1/common.proto | 32 +++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/api/proto/banyandb/common/v1/common.proto b/api/proto/banyandb/common/v1/common.proto
index 7c8885b0..3db00dd6 100644
--- a/api/proto/banyandb/common/v1/common.proto
+++ b/api/proto/banyandb/common/v1/common.proto
@@ -59,6 +59,31 @@ message IntervalRule {
   uint32 num = 2 [(validate.rules).uint32.gt = 0];
 }
 
+message LifecycleStage {
+  // The stage name (e.g., "warm", "cold").
+  // This should be a non-empty string.
+  string name = 1 [(validate.rules).string.min_len = 1];
+
+  // Number of shards allocated for this stage.
+  // Must be greater than zero.
+  uint32 shard_num = 2 [(validate.rules).uint32.gt = 0];
+
+  // Defines the interval for data segmentation in this stage.
+  // This is a required field and uses the IntervalRule structure.
+  IntervalRule segment_interval = 3 [(validate.rules).message.required = true];
+
+  // Specifies the time-to-live for data in this stage before moving to the next.
+  // This is also a required field using the IntervalRule structure.
+  IntervalRule ttl = 4 [(validate.rules).message.required = true];
+
+  // Node selector specifying target nodes for this stage.
+  // Optional; if provided, it must be a non-empty string.
+  string node_selector = 5 [(validate.rules).string.min_len = 1];
+
+  // Indicates whether segments that are no longer live should be closed.
+  bool close = 6;
+}
+
 message ResourceOpts {
   // shard_num is the number of shards
   uint32 shard_num = 1 [(validate.rules).uint32.gt = 0];
@@ -66,6 +91,13 @@ message ResourceOpts {
   IntervalRule segment_interval = 2;
   // ttl indicates time to live, how long the data will be cached
   IntervalRule ttl = 3;
+  // stages defines the ordered lifecycle stages. Data progresses through these stages sequentially.
+  repeated LifecycleStage stages = 4 [
+    (validate.rules).repeated = {
+      min_items: 1,
+      items: {message: {required: true}}
+    }
+  ];
 }
 
 // Group is an internal object for Group management