-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
writing block level dedup to sharded files (rocksdb was too slow)
- Loading branch information
Showing
16 changed files
with
624 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use std::path::PathBuf; | ||
|
||
use async_trait::async_trait; | ||
use clap::{Arg, Command}; | ||
|
||
use liboxen::command; | ||
use liboxen::error::OxenError; | ||
|
||
use crate::cmd::RunCmd; | ||
pub const NAME: &str = "count"; | ||
|
||
pub struct DbCountCmd; | ||
|
||
#[async_trait] | ||
impl RunCmd for DbCountCmd { | ||
fn name(&self) -> &str { | ||
NAME | ||
} | ||
|
||
fn args(&self) -> Command { | ||
// Setups the CLI args for the command | ||
Command::new(NAME) | ||
.about("List the full key value database.") | ||
.arg(Arg::new("PATH").help("The path of the database.")) | ||
} | ||
|
||
async fn run(&self, args: &clap::ArgMatches) -> Result<(), OxenError> { | ||
// Parse Args | ||
let Some(path) = args.get_one::<String>("PATH") else { | ||
return Err(OxenError::basic_str("Must supply path")); | ||
}; | ||
|
||
let count = command::db::count(PathBuf::from(path))?; | ||
|
||
println!("There are {} entries in the database", count); | ||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.