@@ -35,14 +35,13 @@ use crate::{
3535 logstream:: error:: StreamError ,
3636 query:: { QueryError , update_schema_when_distributed} ,
3737 } ,
38- hottier:: { HotTierError , HotTierManager , StreamHotTier } ,
38+ hottier:: HotTierError ,
3939 parseable:: { PARSEABLE , StreamNotFound } ,
4040 query:: { CountsRequest , CountsResponse , error:: ExecuteError } ,
4141 rbac:: { Users , map:: SessionKey , role:: Action } ,
4242 stats,
4343 storage:: { StreamInfo , StreamType , retention:: Retention } ,
4444 utils:: time:: TimeParseError ,
45- validator:: error:: HotTierValidationError ,
4645} ;
4746
4847#[ derive( Serialize ) ]
@@ -177,20 +176,8 @@ pub async fn get_stream_info_helper(stream_name: &str) -> Result<StreamInfo, Str
177176 . read ( )
178177 . expect ( LOCK_EXPECT ) ;
179178
180- let stream_info = StreamInfo {
181- stream_type : stream_meta. stream_type ,
182- created_at : stream_meta. created_at . clone ( ) ,
183- first_event_at : stream_first_event_at,
184- latest_event_at : stream_latest_event_at,
185- time_partition : stream_meta. time_partition . clone ( ) ,
186- time_partition_limit : stream_meta
187- . time_partition_limit
188- . map ( |limit| limit. to_string ( ) ) ,
189- custom_partition : stream_meta. custom_partition . clone ( ) ,
190- static_schema_flag : stream_meta. static_schema_flag ,
191- log_source : stream_meta. log_source . clone ( ) ,
192- telemetry_type : stream_meta. telemetry_type ,
193- } ;
179+ let stream_info =
180+ StreamInfo :: from_metadata ( & stream_meta, stream_first_event_at, stream_latest_event_at) ;
194181
195182 Ok ( stream_info)
196183}
@@ -210,8 +197,6 @@ pub struct PrismDatasetResponse {
210197 stats : QueriedStats ,
211198 /// Retention policy details
212199 retention : Retention ,
213- /// Hot tier information if available
214- hottier : Option < StreamHotTier > ,
215200 /// Count of records in the specified time range
216201 counts : CountsResponse ,
217202}
@@ -313,9 +298,6 @@ impl PrismDatasetRequest {
313298 stream : String ,
314299 info : PrismLogstreamInfo ,
315300 ) -> Result < PrismDatasetResponse , PrismLogstreamError > {
316- // Get hot tier info
317- let hottier = self . get_hot_tier_info ( & stream) . await ?;
318-
319301 // Get counts
320302 let counts = self . get_counts ( & stream) . await ?;
321303
@@ -325,27 +307,10 @@ impl PrismDatasetRequest {
325307 schema : info. schema ,
326308 stats : info. stats ,
327309 retention : info. retention ,
328- hottier,
329310 counts,
330311 } )
331312 }
332313
333- async fn get_hot_tier_info (
334- & self ,
335- stream : & str ,
336- ) -> Result < Option < StreamHotTier > , PrismLogstreamError > {
337- match HotTierManager :: global ( ) {
338- Some ( manager) => match manager. get_hot_tier ( stream) . await {
339- Ok ( stats) => Ok ( Some ( stats) ) ,
340- Err ( HotTierError :: HotTierValidationError ( HotTierValidationError :: NotFound ( _) ) ) => {
341- Ok ( None )
342- }
343- Err ( err) => Err ( err. into ( ) ) ,
344- } ,
345- None => Ok ( None ) ,
346- }
347- }
348-
349314 async fn get_counts ( & self , stream : & str ) -> Result < CountsResponse , PrismLogstreamError > {
350315 let count_request = CountsRequest {
351316 stream : stream. to_owned ( ) ,
0 commit comments