Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAS client API refactor; Shard and CAS object format changes to use chunk indices #29

Merged
merged 21 commits into from
Oct 4, 2024
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
6 changes: 5 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[workspace]
rust-version = "1.79"

resolver = "2"

members = [
Expand Down
1 change: 1 addition & 0 deletions cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
cas_types = { path = "../cas_types" }
utils = { path = "../utils" }
tokio = { version = "1.36", features = ["full"] }
async-trait = "0.1.9"
Expand Down
2 changes: 1 addition & 1 deletion cache/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::CacheError::OtherTaskError;
use cas::errors::SingleflightError;
use tracing::error;
use utils::errors::SingleflightError;
use xet_error::Error;

#[non_exhaustive]
Expand Down
6 changes: 3 additions & 3 deletions cache/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use std::{fmt::Debug, sync::Arc};

use crate::error::Result;
pub use block::BlockConverter;
use cas::key::Key;
use cas::singleflight;
use cas_types::Key;
pub use disk::DiskCache;
pub use error::CacheError;
pub use interface::{BlockReadRequest, BlockReader, FileMetadata};
pub use metrics::set_metrics_service_name;
use utils::singleflight;
pub use xorb_cache::XorbCacheImpl;

mod block;
Expand All @@ -29,7 +29,7 @@ mod xorb_cache;
pub trait Remote: Debug + Sync + Send {
async fn fetch(
&self,
key: &cas::key::Key,
key: &Key,
range: Range<u64>,
) -> std::result::Result<Vec<u8>, anyhow::Error>;
}
Expand Down
4 changes: 2 additions & 2 deletions cache/src/xorb_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::time::SystemTime;
use tracing::{debug, info, info_span, warn};
use tracing_futures::Instrument;

use cas::key::Key;
use cas::singleflight;
use cas_types::Key;
use utils::singleflight;

use crate::metrics::{
BLOCKS_READ, DATA_READ, READ_ERROR_COUNT, REQUEST_LATENCY_MS, REQUEST_THROUGHPUT,
Expand Down
2 changes: 1 addition & 1 deletion cas_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ strict = []
[dependencies]
cas_object = {path = "../cas_object"}
error_printer = {path = "../error_printer"}
file_utils = {path = "../file_utils"}
utils = {path = "../utils"}
merkledb = {path = "../merkledb"}
merklehash = { path = "../merklehash" }
parutils = {path = "../parutils"}
retry_strategy = {path = "../retry_strategy"}
progress_reporting = {path = "../progress_reporting"}
tonic = {version = "0.10.2", features = ["tls", "tls-roots", "transport"] }
prost = "0.12.3"
tokio = { version = "1.36", features = ["full"] }
Expand Down
2 changes: 1 addition & 1 deletion cas_client/src/auth.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use anyhow::anyhow;
use cas::auth::{AuthConfig, TokenProvider};
use reqwest::header::HeaderValue;
use reqwest::header::AUTHORIZATION;
use reqwest::{Request, Response};
use reqwest_middleware::{Middleware, Next};
use std::sync::{Arc, Mutex};
use utils::auth::{AuthConfig, TokenProvider};

/// AuthMiddleware is a thread-safe middleware that adds a CAS auth token to outbound requests.
/// If the token it holds is expired, it will automatically be refreshed.
Expand Down
Loading