Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/mito2/src/sst/parquet/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@

use std::ops::Range;
use std::sync::Arc;
use std::time::Instant;

use bytes::Bytes;
use common_telemetry::trace;
use object_store::ObjectStore;
use parquet::basic::ColumnOrder;
use parquet::file::metadata::{FileMetaData, ParquetMetaData, RowGroupMetaData};
Expand Down Expand Up @@ -100,7 +102,10 @@ pub async fn fetch_byte_ranges(
object_store: ObjectStore,
ranges: &[Range<u64>],
) -> object_store::Result<Vec<Bytes>> {
Ok(object_store
let total_size = ranges.iter().map(|r| r.end - r.start).sum::<u64>();
let start = Instant::now();

let result = object_store
.reader_with(file_path)
.concurrent(FETCH_PARALLELISM)
.gap(MERGE_GAP)
Expand All @@ -109,5 +114,14 @@ pub async fn fetch_byte_ranges(
.await?
.into_iter()
.map(|buf| buf.to_bytes())
.collect::<Vec<_>>())
.collect::<Vec<_>>();

trace!(
"Fetch {} bytes from '{}' in object store, cost: {:?}",
total_size,
file_path,
start.elapsed()
);

Ok(result)
}
7 changes: 6 additions & 1 deletion src/object-store/src/layers/lru_cache/read_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use std::sync::Arc;

use common_telemetry::debug;
use common_telemetry::{debug, trace};
use futures::{FutureExt, TryStreamExt};
use moka::future::Cache;
use moka::notification::ListenerFuture;
Expand Down Expand Up @@ -290,6 +290,11 @@ impl<C: Access> ReadCache<C> {
let (_, reader) = inner.read(path, args).await?;
let result = self.try_write_cache::<I>(reader, read_key).await;

trace!(
"Read cache miss for key '{}' and fetch file '{}' from object store",
read_key, path,
);

match result {
Ok(read_bytes) => {
OBJECT_STORE_LRU_CACHE_ENTRIES.inc();
Expand Down