Skip to content

Commit

Permalink
chore: add more traces
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Nov 8, 2024
1 parent 72625bb commit b1b98b5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/mito2/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use std::mem;
use std::sync::Arc;

use bytes::Bytes;
use common_telemetry::tracing;
use datatypes::value::Value;
use datatypes::vectors::VectorRef;
use moka::notification::RemovalCause;
Expand Down Expand Up @@ -82,6 +83,7 @@ impl CacheManager {

/// Gets cached [ParquetMetaData] from in-memory cache first.
/// If not found, tries to get it from write cache and fill the in-memory cache.
#[tracing::instrument(level = tracing::Level::DEBUG, skip_all)]
pub async fn get_parquet_meta_data(
&self,
region_id: RegionId,
Expand Down
3 changes: 2 additions & 1 deletion src/mito2/src/cache/file_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::time::{Duration, Instant};

use bytes::Bytes;
use common_base::readable_size::ReadableSize;
use common_telemetry::{info, warn};
use common_telemetry::{info, tracing, warn};
use futures::{FutureExt, TryStreamExt};
use moka::future::Cache;
use moka::notification::RemovalCause;
Expand Down Expand Up @@ -241,6 +241,7 @@ impl FileCache {

/// Get the parquet metadata in file cache.
/// If the file is not in the cache or fail to load metadata, return None.
#[tracing::instrument(level = tracing::Level::DEBUG, skip_all)]
pub(crate) async fn get_parquet_meta_data(&self, key: IndexKey) -> Option<ParquetMetaData> {
// Check if file cache contains the key
if let Some(index_value) = self.memory_index.get(&key).await {
Expand Down
1 change: 1 addition & 0 deletions src/mito2/src/read/scan_region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,7 @@ struct FileRangeBuilder {
impl FileRangeBuilder {
/// Builds file ranges to read.
/// Negative `row_group_index` indicates all row groups.
#[tracing::instrument(level = tracing::Level::DEBUG, skip_all)]
fn build_ranges(&self, row_group_index: i64, ranges: &mut SmallVec<[FileRange; 2]>) {
let Some(context) = self.context.clone() else {
return;
Expand Down
2 changes: 2 additions & 0 deletions src/mito2/src/sst/parquet/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use common_telemetry::tracing;
use object_store::ObjectStore;
use parquet::file::footer::{decode_footer, decode_metadata};
use parquet::file::metadata::ParquetMetaData;
Expand Down Expand Up @@ -70,6 +71,7 @@ impl<'a> MetadataLoader<'a> {
/// ```
///
/// Refer to https://github.com/apache/arrow-rs/blob/093a10e46203be1a0e94ae117854701bf58d4c79/parquet/src/arrow/async_reader/metadata.rs#L55-L106
#[tracing::instrument(level = tracing::Level::DEBUG, skip_all)]
pub async fn load(&self) -> Result<ParquetMetaData> {
let object_store = &self.object_store;
let path = self.file_path;
Expand Down
1 change: 1 addition & 0 deletions src/mito2/src/sst/parquet/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ impl ParquetReaderBuilder {
}

/// Reads parquet metadata of specific file.
#[tracing::instrument(level = tracing::Level::DEBUG, skip_all)]
async fn read_parquet_metadata(
&self,
file_path: &str,
Expand Down

0 comments on commit b1b98b5

Please sign in to comment.