From a4f51d99f6a906396938cdbb767e1e378fec6f7a Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Wed, 1 Jun 2022 17:02:02 -0400 Subject: [PATCH] feat: Use the read buffer chunk cache in the querier --- querier/src/cache/mod.rs | 12 +++++++++++- querier/src/table/state_reconciler.rs | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/querier/src/cache/mod.rs b/querier/src/cache/mod.rs index 52259adcbc..fa70536f9f 100644 --- a/querier/src/cache/mod.rs +++ b/querier/src/cache/mod.rs @@ -47,6 +47,9 @@ pub struct CatalogCache { /// tombstone cache tombstone_cache: TombstoneCache, + /// Read buffer chunk cache + read_buffer_cache: ReadBufferCache, + /// Time provider. time_provider: Arc, } @@ -104,6 +107,12 @@ impl CatalogCache { ); let tombstone_cache = TombstoneCache::new( Arc::clone(&catalog), + backoff_config.clone(), + Arc::clone(&time_provider), + &metric_registry, + Arc::clone(&ram_pool), + ); + let read_buffer_cache = ReadBufferCache::new( backoff_config, Arc::clone(&time_provider), &metric_registry, @@ -118,6 +127,7 @@ impl CatalogCache { processed_tombstones_cache, parquet_file_cache, tombstone_cache, + read_buffer_cache, time_provider, } } @@ -164,6 +174,6 @@ impl CatalogCache { /// Read buffer chunk cache. pub(crate) fn read_buffer(&self) -> &ReadBufferCache { - unimplemented!("Deliberately not hooking up this cache yet"); + &self.read_buffer_cache } } diff --git a/querier/src/table/state_reconciler.rs b/querier/src/table/state_reconciler.rs index 5bdcf359c4..16bab78a8b 100644 --- a/querier/src/table/state_reconciler.rs +++ b/querier/src/table/state_reconciler.rs @@ -116,7 +116,7 @@ impl Reconciler { for cached_parquet_file in parquet_files { if let Some(chunk) = self .chunk_adapter - .new_querier_parquet_chunk(&cached_parquet_file) + .new_rb_chunk(Arc::clone(&cached_parquet_file)) .await { chunks_from_parquet.push(chunk);