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
2 changes: 1 addition & 1 deletion benchmark/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use fastrace::Span;
use fastrace::future::FutureExt as _;
use liquid_cache::cache::CacheStats;
use liquid_cache::cache::{Evict, EvictionPolicy, TranscodeEvict};
use liquid_cache_common::rpc::ExecutionMetricsResponse;
use liquid_cache_common::metrics::ExecutionMetricsResponse;
use liquid_cache_datafusion_server::{ApiResponse, ExecutionStats};
use log::info;
use serde::Serialize;
Expand Down
12 changes: 10 additions & 2 deletions src/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,26 @@ readme = "README.md"
description = { workspace = true }
repository = { workspace = true }

[features]
# Arrow Flight RPC message types used between the client and the server.
rpc = ["dep:arrow-flight", "dep:prost"]

[dependencies]
arrow-flight = { workspace = true }
arrow-flight = { workspace = true, optional = true }
async-trait = { workspace = true }
bytes = { workspace = true }
chrono = "0.4.45"
futures = { workspace = true }
object_store = { workspace = true }
prost = { workspace = true }
prost = { workspace = true, optional = true }
serde = { workspace = true }
thiserror = "2.0.18"
tokio = { workspace = true }
url = { workspace = true }

[dev-dependencies]
tempfile = { workspace = true }
tokio = { workspace = true, features = ["macros"] }

[package.metadata.docs.rs]
features = ["rpc"]
2 changes: 2 additions & 0 deletions src/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
Common types and utilities shared across LiquidCache components.

This crate contains shared data structures, enums, and utility functions used throughout the LiquidCache ecosystem. It defines the core abstractions for cache modes, schema transformations, and RPC message types that enable communication between client and server components.

The RPC message types (`rpc` module) are behind the `rpc` feature, which is off by default. The client and server crates enable it; in-process use through `liquid-cache-datafusion-local` does not need it, and so does not depend on Arrow Flight or gRPC.
2 changes: 2 additions & 0 deletions src/common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#![doc = include_str!("../README.md")]

pub mod metrics;
pub mod mock_store;
#[cfg(feature = "rpc")]
pub mod rpc;
pub mod utils;
18 changes: 18 additions & 0 deletions src/common/src/metrics.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//! Execution metrics reported for a query plan.

#[derive(Clone, PartialEq, serde::Serialize, serde::Deserialize, Debug)]
pub struct ExecutionMetricsResponse {
pub pushdown_eval_time: u64,
pub cache_memory_usage: u64,
pub liquid_cache_usage: u64,
}

impl ExecutionMetricsResponse {
pub fn zero() -> Self {
Self {
pushdown_eval_time: 0,
cache_memory_usage: 0,
liquid_cache_usage: 0,
}
}
}
17 changes: 0 additions & 17 deletions src/common/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,20 +246,3 @@ impl ProstMessageExt for FetchResults {
}
}
}

#[derive(Clone, PartialEq, serde::Serialize, serde::Deserialize, Debug)]
pub struct ExecutionMetricsResponse {
pub pushdown_eval_time: u64,
pub cache_memory_usage: u64,
pub liquid_cache_usage: u64,
}

impl ExecutionMetricsResponse {
pub fn zero() -> Self {
Self {
pushdown_eval_time: 0,
cache_memory_usage: 0,
liquid_cache_usage: 0,
}
}
}
4 changes: 2 additions & 2 deletions src/datafusion-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ arrow-schema = { workspace = true }
futures = { workspace = true }
tonic = { workspace = true }
uuid = { workspace = true }
liquid-cache-common = { workspace = true }
liquid-cache-common = { workspace = true, features = ["rpc"] }
liquid-cache-datafusion = { workspace = true }
fastrace = { workspace = true }
fastrace-tonic = { workspace = true }
tower = "0.5.3"
tokio = { workspace = true }
object_store = { workspace = true }
object_store = { workspace = true, features = ["http"] }

[dev-dependencies]
insta = { workspace = true }
2 changes: 1 addition & 1 deletion src/datafusion-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tokio = { workspace = true }
url = { workspace = true }
liquid-cache-datafusion = { workspace = true }
object_store = { workspace = true, features = ["aws", "http"] }
liquid-cache-common = { workspace = true }
liquid-cache-common = { workspace = true, features = ["rpc"] }
tempfile = { workspace = true }
axum = "0.8.9"
serde = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion src/datafusion-server/src/admin_server/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use datafusion::{
datasource::physical_plan::FileScanConfig,
physical_plan::{ExecutionPlan, StatisticsArgs, StatisticsContext},
};
use liquid_cache_common::rpc::ExecutionMetricsResponse;
use liquid_cache_common::metrics::ExecutionMetricsResponse;
use liquid_cache_datafusion::LiquidParquetSource;
use log::info;
use serde::Serialize;
Expand Down
2 changes: 1 addition & 1 deletion src/datafusion-server/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use datafusion::{
};
use liquid_cache::{ByteCache, cache::EvictionPolicy};
use liquid_cache::{cache::HydrationPolicy, cache_policies::CachePolicy};
use liquid_cache_common::rpc::ExecutionMetricsResponse;
use liquid_cache_common::metrics::ExecutionMetricsResponse;
use liquid_cache_datafusion::{
cache::{ColumnLineages, LiquidCacheParquet, LiquidCacheParquetRef},
extract_execution_metrics,
Expand Down
2 changes: 1 addition & 1 deletion src/datafusion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ futures = { workspace = true }
tokio = { workspace = true }
ahash = { workspace = true }
log = { workspace = true }
object_store = { workspace = true, features = ["http"] }
object_store = { workspace = true }
liquid-cache-common = { workspace = true }
liquid-cache = { workspace = true }
fastrace = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion src/datafusion/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use datafusion::{
datasource::source::DataSourceExec,
physical_plan::{ExecutionPlan, metrics::MetricValue},
};
use liquid_cache_common::rpc::ExecutionMetricsResponse;
use liquid_cache_common::metrics::ExecutionMetricsResponse;
use parquet::arrow::arrow_reader::RowSelector;

use crate::cache::LiquidCacheParquetRef;
Expand Down
Loading