Skip to content

Commit aca604f

Browse files
committed
fix: delete hottier, query cache metric
1 parent b2fae6f commit aca604f

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

src/hottier.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,17 @@ impl HotTierManager {
213213
if !self.check_stream_hot_tier_exists(stream, tenant_id) {
214214
return Err(HotTierValidationError::NotFound(stream.to_owned()).into());
215215
}
216-
let path = self.hot_tier_path.join(stream);
216+
let path = if let Some(tenant_id) = tenant_id.as_ref() {
217+
self.hot_tier_path.join(tenant_id).join(stream)
218+
} else {
219+
self.hot_tier_path.join(stream)
220+
};
217221
fs::remove_dir_all(path).await?;
218222

219223
Ok(())
220224
}
221225

222-
///put the hot tier metadata file for the stream
226+
/// put the hot tier metadata file for the stream
223227
/// set the updated_date_range in the hot tier metadata file
224228
pub async fn put_hot_tier(
225229
&self,
@@ -239,10 +243,6 @@ impl HotTierManager {
239243
stream: &str,
240244
tenant_id: &Option<String>,
241245
) -> Result<object_store::path::Path, HotTierError> {
242-
// let path = self
243-
// .hot_tier_path
244-
// .join(stream)
245-
// .join(STREAM_HOT_TIER_FILENAME);
246246
let path = if let Some(tenant_id) = tenant_id.as_ref() {
247247
self.hot_tier_path
248248
.join(tenant_id)
@@ -258,7 +258,7 @@ impl HotTierManager {
258258
Ok(path)
259259
}
260260

261-
///schedule the download of the hot tier files from S3 every minute
261+
/// schedule the download of the hot tier files from S3 every minute
262262
pub fn download_from_s3<'a>(&'a self) -> Result<(), HotTierError>
263263
where
264264
'a: 'static,
@@ -282,7 +282,7 @@ impl HotTierManager {
282282
Ok(())
283283
}
284284

285-
///sync the hot tier files from S3 to the hot tier directory for all streams
285+
/// sync the hot tier files from S3 to the hot tier directory for all streams
286286
async fn sync_hot_tier(&self) -> Result<(), HotTierError> {
287287
// Before syncing, check if pstats stream was created and needs hot tier
288288
if let Err(e) = self.create_pstats_hot_tier().await {

src/query/stream_schema_provider.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -629,16 +629,17 @@ impl TableProvider for StandardTableProvider {
629629
.await?;
630630
}
631631
if manifest_files.is_empty() {
632-
QUERY_CACHE_HIT.with_label_values(&[&self.stream]).inc();
632+
QUERY_CACHE_HIT
633+
.with_label_values(&[
634+
&self.stream,
635+
self.tenant_id.as_deref().unwrap_or(DEFAULT_TENANT),
636+
])
637+
.inc();
633638
return self.final_plan(execution_plans, projection);
634639
}
635640

636641
let (partitioned_files, statistics) = self.partitioned_files(manifest_files);
637-
// let object_store_url = if let Some(tenant_id) = self.tenant_id.as_ref() {
638-
// glob_storage.store_url().join(tenant_id).unwrap()
639-
// } else {
640-
// glob_storage.store_url()
641-
// };
642+
642643
let object_store_url = glob_storage.store_url();
643644

644645
self.create_parquet_physical_plan(

0 commit comments

Comments
 (0)