Skip to content
Open
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: 2 additions & 0 deletions gitxet/Cargo.lock

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

16 changes: 8 additions & 8 deletions gitxet/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ mod git_integration_tests {
.run()
}

#[test]
fn test_stored_notes() -> anyhow::Result<()> {
IntegrationTest::new(include_str!("integration_tests/test_stored_notes.sh")).run()
}
// #[test]
// fn test_stored_notes() -> anyhow::Result<()> {
// IntegrationTest::new(include_str!("integration_tests/test_stored_notes.sh")).run()
// }

#[test]
fn test_lfs_locking_install() -> anyhow::Result<()> {
Expand Down Expand Up @@ -296,10 +296,10 @@ mod git_integration_tests {
IntegrationTest::new(include_str!("integration_tests/test_merkledb_upgrade.sh")).run()
}

#[test]
fn test_xet_lazy() -> anyhow::Result<()> {
IntegrationTest::new(include_str!("integration_tests/test_xet_lazy.sh")).run()
}
// #[test]
// fn test_xet_lazy() -> anyhow::Result<()> {
// IntegrationTest::new(include_str!("integration_tests/test_xet_lazy.sh")).run()
// }

#[test]
fn test_repo_migration() -> anyhow::Result<()> {
Expand Down
26 changes: 9 additions & 17 deletions libxet/Cargo.lock

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

14 changes: 9 additions & 5 deletions rust/cas_client/src/caching_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ use std::sync::Arc;
use tokio::sync::Mutex;
use tracing::{debug, info};

#[allow(dead_code)]
const DEFAULT_BLOCK_SIZE: u64 = 16 * 1024 * 1024;

#[derive(Debug)]
pub struct CachingClient<T: Client + Debug + Sync + Send + 'static> {
client: Arc<T>,
Expand All @@ -28,7 +31,7 @@ impl<T: Client + Debug + Sync + Send + 'static> CachingClient<T> {
client: T,
cache_path: &Path,
capacity_bytes: u64,
blocksize: Option<u64>,
block_size: u64,
) -> Result<CachingClient<T>> {
// convert Path to String
let canonical_path = cache_path.canonicalize().map_err(|e| {
Expand All @@ -47,14 +50,14 @@ impl<T: Client + Debug + Sync + Send + 'static> CachingClient<T> {
cache::CacheConfig {
cache_dir: canonical_string_path.to_string(),
capacity: capacity_bytes,
block_size: blocksize.unwrap_or(16 * 1024 * 1024),
block_size,
},
client_remote_arc,
)?;

info!(
"Creating CachingClient, path={:?}, byte capacity={}, blocksize={:?}",
cache_path, capacity_bytes, blocksize
cache_path, capacity_bytes, block_size
);

Ok(CachingClient {
Expand Down Expand Up @@ -163,6 +166,7 @@ impl<T: Client + Debug + Sync + Send> Client for CachingClient<T> {

#[cfg(test)]
mod tests {
use super::DEFAULT_BLOCK_SIZE;
use crate::*;
use std::fs;
use std::path::Path;
Expand All @@ -179,7 +183,7 @@ mod tests {
let cachedir = TempDir::new().unwrap();
assert!(!path_has_files(cachedir.path()));

let client = CachingClient::new(client, cachedir.path(), 100, None).unwrap();
let client = CachingClient::new(client, cachedir.path(), 100, DEFAULT_BLOCK_SIZE).unwrap();

// the root hash of a single chunk is just the hash of the data
let hello = "hello world".as_bytes().to_vec();
Expand Down Expand Up @@ -235,7 +239,7 @@ mod tests {
let cachedir = TempDir::new().unwrap();
assert!(!path_has_files(cachedir.path()));

let client = CachingClient::new(client, cachedir.path(), 100, None).unwrap();
let client = CachingClient::new(client, cachedir.path(), 100, DEFAULT_BLOCK_SIZE).unwrap();

let hello = "hello world".as_bytes().to_vec();
let hello_hash = merklehash::compute_data_hash(&hello[..]);
Expand Down
2 changes: 2 additions & 0 deletions rust/gitxetcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ lz4 = "1.24.0"
git-url-parse = "0.4.4"
path-absolutize = "3.1.1" # Can drop after rust 1.79
static_assertions = "1.1.0"
gearhash = "0.1.3"
rand_chacha = "0.3.1"

# tracing
tracing-futures = "0.2"
Expand Down
4 changes: 2 additions & 2 deletions rust/gitxetcore/src/command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use visualization_dependencies::{
use crate::config::XetConfig;
use crate::config::{get_sanitized_invocation_command, ConfigGitPathOption};
use crate::constants::CURRENT_VERSION;
use crate::data::remote_shard_interface::{GlobalDedupPolicy, SmudgeQueryPolicy};
use crate::data::configurations::{FileQueryPolicy, GlobalDedupPolicy};
use crate::environment::axe::Axe;
use crate::environment::log::{get_trace_span, initialize_tracing_subscriber};
use crate::environment::upgrade_checks::VersionCheckInfo;
Expand Down Expand Up @@ -213,7 +213,7 @@ pub struct CliOverrides {

/// Sets the shard reconstruction policy for the
#[clap(long, hide = true)]
pub smudge_query_policy: Option<SmudgeQueryPolicy>,
pub smudge_query_policy: Option<FileQueryPolicy>,

/// Sets the global dedup policy for when to query the shard server for other shards to dedup against
#[clap(long, hide = true)]
Expand Down
12 changes: 6 additions & 6 deletions rust/gitxetcore/src/config/xet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::constants::{
CAS_STAGING_SUBDIR, GIT_LAZY_CHECKOUT_CONFIG, GIT_REPO_SPECIFIC_CONFIG, MERKLEDBV1_PATH_SUBDIR,
MERKLEDB_V2_CACHE_PATH_SUBDIR, MERKLEDB_V2_SESSION_PATH_SUBDIR, SUMMARIES_PATH_SUBDIR,
};
use crate::data::remote_shard_interface::{GlobalDedupPolicy, SmudgeQueryPolicy};
use crate::data::configurations::{FileQueryPolicy, GlobalDedupPolicy};
use crate::errors::GitXetRepoError;
use crate::git_integration::git_url::ssh_url_to_https_url;
use crate::git_integration::{run_git_captured, GitXetRepo};
Expand Down Expand Up @@ -82,7 +82,7 @@ pub struct XetConfig {
pub merkledb_v2_cache: PathBuf,
// The directory to hold MDB shards created in a session (between pushes).
pub merkledb_v2_session: PathBuf,
pub smudge_query_policy: SmudgeQueryPolicy,
pub file_query_policy: FileQueryPolicy,

/// The global dedup policy
pub global_dedup_query_policy: GlobalDedupPolicy,
Expand Down Expand Up @@ -117,7 +117,7 @@ impl XetConfig {
merkledb: Default::default(),
merkledb_v2_cache: Default::default(),
merkledb_v2_session: Default::default(),
smudge_query_policy: Default::default(),
file_query_policy: Default::default(),
global_dedup_query_policy: Default::default(),
summarydb: Default::default(),
staging_path: None,
Expand Down Expand Up @@ -401,7 +401,7 @@ impl XetConfig {
merkledb: Default::default(),
merkledb_v2_cache: Default::default(),
merkledb_v2_session: Default::default(),
smudge_query_policy: Default::default(),
file_query_policy: Default::default(),
global_dedup_query_policy: Default::default(),
summarydb: Default::default(),
staging_path: None,
Expand Down Expand Up @@ -577,9 +577,9 @@ impl XetConfig {

fn try_with_smudge_query_policy(
mut self,
smudge_query_policy: Option<SmudgeQueryPolicy>,
smudge_query_policy: Option<FileQueryPolicy>,
) -> Result<Self, ConfigError> {
self.smudge_query_policy = smudge_query_policy.unwrap_or_default();
self.file_query_policy = smudge_query_policy.unwrap_or_default();
Ok(self)
}

Expand Down
Loading