aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormokhotskii <mokhotskii@ydb.tech>2022-08-05 16:03:34 +0300
committermokhotskii <mokhotskii@ydb.tech>2022-08-05 16:03:34 +0300
commit18d6e1a62a6bef20b8547089b142cc976092cbae (patch)
tree1bf28662053c36fce54ad8a592ff1ccc15bdb918
parentc64c4f299ec437313284b71a45c361659c7997c0 (diff)
downloadydb-18d6e1a62a6bef20b8547089b142cc976092cbae.tar.gz
Introduce storage_limit_mb in YDS DescribeStream response
Introduce storage_limit_mb in YDS DescribeStream response
-rw-r--r--ydb/public/api/protos/draft/datastreams.proto4
-rw-r--r--ydb/services/datastreams/datastreams_proxy.cpp4
-rw-r--r--ydb/services/datastreams/datastreams_ut.cpp1
3 files changed, 9 insertions, 0 deletions
diff --git a/ydb/public/api/protos/draft/datastreams.proto b/ydb/public/api/protos/draft/datastreams.proto
index 967e3450203..a0791736cae 100644
--- a/ydb/public/api/protos/draft/datastreams.proto
+++ b/ydb/public/api/protos/draft/datastreams.proto
@@ -103,8 +103,12 @@ message StreamDescription {
StreamStatus stream_status = 9;
// Name of the stream
string stream_name = 10;
+ // YDS-specific Write quota in KB/S
int32 write_quota_kb_per_sec = 11;
+ // YDS-specific Owner of the stream
string owner = 12;
+ // YDS-specific Storage limit in MB of the stream
+ int64 storage_limit_mb = 13;
}
// Represents range of possible sequence numbers for the shard
diff --git a/ydb/services/datastreams/datastreams_proxy.cpp b/ydb/services/datastreams/datastreams_proxy.cpp
index 582e899e420..5ad636b3e63 100644
--- a/ydb/services/datastreams/datastreams_proxy.cpp
+++ b/ydb/services/datastreams/datastreams_proxy.cpp
@@ -609,6 +609,10 @@ namespace NKikimr::NDataStreams::V1 {
ui32 retentionPeriodHours = TInstant::Seconds(pqConfig.GetPartitionConfig().GetLifetimeSeconds()).Hours();
description.set_retention_period_hours(retentionPeriodHours);
description.set_write_quota_kb_per_sec(writeSpeed);
+ if (pqConfig.GetPartitionConfig().HasStorageLimitBytes()) {
+ ui32 storageLimitMb = pqConfig.GetPartitionConfig().GetStorageLimitBytes() / 1_MB;
+ description.set_storage_limit_mb(storageLimitMb);
+ }
if (SelfInfo.GetCreateFinished()) {
description.set_stream_status(Ydb::DataStreams::V1::StreamDescription::ACTIVE);
} else {
diff --git a/ydb/services/datastreams/datastreams_ut.cpp b/ydb/services/datastreams/datastreams_ut.cpp
index 8f47f8e5766..abc400d4fb0 100644
--- a/ydb/services/datastreams/datastreams_ut.cpp
+++ b/ydb/services/datastreams/datastreams_ut.cpp
@@ -631,6 +631,7 @@ Y_UNIT_TEST_SUITE(DataStreams) {
UNIT_ASSERT_VALUES_EQUAL(result.GetResult().stream_description().write_quota_kb_per_sec(), 1_KB);
UNIT_ASSERT_VALUES_EQUAL(result.GetResult().stream_description().retention_period_hours(),
TDuration::Days(7).Hours());
+ UNIT_ASSERT_VALUES_EQUAL(result.GetResult().stream_description().storage_limit_mb(), 50_GB / 1_MB);
}
}