From 2fc8aed1445a5266d7455d15be0963d6f5267edc Mon Sep 17 00:00:00 2001 From: Nikhil Sinha Date: Wed, 14 Jan 2026 16:22:40 +1100 Subject: [PATCH] fix: hottier in datasets add hot_tier_enabled = true/false in StreamInfo that fetches the data from stream.json remove redundant key `hottier` from DatasetsResponse as this info is available inside StreamInfo --- src/handlers/http/logstream.rs | 16 ++----------- src/prism/logstream/mod.rs | 41 +++------------------------------- src/storage/mod.rs | 26 +++++++++++++++++++++ 3 files changed, 31 insertions(+), 52 deletions(-) diff --git a/src/handlers/http/logstream.rs b/src/handlers/http/logstream.rs index 2f32ef7e0..79549b86f 100644 --- a/src/handlers/http/logstream.rs +++ b/src/handlers/http/logstream.rs @@ -356,20 +356,8 @@ pub async fn get_stream_info(stream_name: Path) -> Result Result, /// Count of records in the specified time range counts: CountsResponse, } @@ -313,9 +298,6 @@ impl PrismDatasetRequest { stream: String, info: PrismLogstreamInfo, ) -> Result { - // Get hot tier info - let hottier = self.get_hot_tier_info(&stream).await?; - // Get counts let counts = self.get_counts(&stream).await?; @@ -325,27 +307,10 @@ impl PrismDatasetRequest { schema: info.schema, stats: info.stats, retention: info.retention, - hottier, counts, }) } - async fn get_hot_tier_info( - &self, - stream: &str, - ) -> Result, PrismLogstreamError> { - match HotTierManager::global() { - Some(manager) => match manager.get_hot_tier(stream).await { - Ok(stats) => Ok(Some(stats)), - Err(HotTierError::HotTierValidationError(HotTierValidationError::NotFound(_))) => { - Ok(None) - } - Err(err) => Err(err.into()), - }, - None => Ok(None), - } - } - async fn get_counts(&self, stream: &str) -> Result { let count_request = CountsRequest { stream: stream.to_owned(), diff --git a/src/storage/mod.rs b/src/storage/mod.rs index 49c481244..29d5795cf 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -169,6 +169,32 @@ pub struct StreamInfo { pub log_source: Vec, #[serde(default)] pub telemetry_type: TelemetryType, + #[serde(default)] + pub hot_tier_enabled: bool, +} + +impl StreamInfo { + /// Creates a StreamInfo from LogStreamMetadata + /// and first_event_at and latest_event_at timestamps + pub fn from_metadata( + metadata: &crate::metadata::LogStreamMetadata, + first_event_at: Option, + latest_event_at: Option, + ) -> Self { + StreamInfo { + stream_type: metadata.stream_type, + created_at: metadata.created_at.clone(), + first_event_at, + latest_event_at, + time_partition: metadata.time_partition.clone(), + time_partition_limit: metadata.time_partition_limit.map(|limit| limit.to_string()), + custom_partition: metadata.custom_partition.clone(), + static_schema_flag: metadata.static_schema_flag, + log_source: metadata.log_source.clone(), + telemetry_type: metadata.telemetry_type, + hot_tier_enabled: metadata.hot_tier_enabled, + } + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize, Default)]