Skip to content

Commit afaa64a

Browse files
author
Devdutt Shenoi
committed
refactor: hot_tier_enabled: bool
1 parent b9f0076 commit afaa64a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/handlers/http/logstream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ pub async fn put_stream_hot_tier(
631631
.await?;
632632
let storage = CONFIG.storage().get_object_store();
633633
let mut stream_metadata = storage.get_object_store_format(&stream_name).await?;
634-
stream_metadata.hot_tier_enabled = Some(true);
634+
stream_metadata.hot_tier_enabled = true;
635635
storage
636636
.put_stream_manifest(&stream_name, &stream_metadata)
637637
.await?;

src/metadata.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub struct LogStreamMetadata {
7474
pub time_partition_limit: Option<NonZeroU32>,
7575
pub custom_partition: Option<String>,
7676
pub static_schema_flag: bool,
77-
pub hot_tier_enabled: Option<bool>,
77+
pub hot_tier_enabled: bool,
7878
pub stream_type: Option<String>,
7979
pub log_source: LogSource,
8080
}
@@ -257,7 +257,7 @@ impl StreamInfo {
257257
let stream = map
258258
.get_mut(stream_name)
259259
.ok_or(MetadataError::StreamMetaNotFound(stream_name.to_string()))?;
260-
stream.hot_tier_enabled = Some(enable);
260+
stream.hot_tier_enabled = enable;
261261
Ok(())
262262
}
263263

src/storage/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ pub struct ObjectStoreFormat {
113113
skip_serializing_if = "std::ops::Not::not"
114114
)]
115115
pub static_schema_flag: bool,
116-
#[serde(skip_serializing_if = "Option::is_none")]
117-
pub hot_tier_enabled: Option<bool>,
116+
#[serde(default)]
117+
pub hot_tier_enabled: bool,
118118
pub stream_type: Option<String>,
119119
#[serde(default)]
120120
pub log_source: LogSource,
@@ -217,7 +217,7 @@ impl Default for ObjectStoreFormat {
217217
time_partition_limit: None,
218218
custom_partition: None,
219219
static_schema_flag: false,
220-
hot_tier_enabled: None,
220+
hot_tier_enabled: false,
221221
log_source: LogSource::default(),
222222
}
223223
}

0 commit comments

Comments
 (0)