diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-01-09 16:52:35 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-01-10 18:17:27 +0200 |
commit | e5f68184bfe91f6874fe8c2344dbd5fa613d6bee (patch) | |
tree | 9860e2bc6c827bf69d1c324303e01c86efd94e65 /src/bin/benchmark-index.rs | |
parent | 7ff248232a414b907b3abe464cc015e5ea48c236 (diff) | |
download | obnam2-e5f68184bfe91f6874fe8c2344dbd5fa613d6bee.tar.gz |
feat! use SQLite db for chunk index on server
This speeds startup a lot. However, the backup repository needs to be
re-created from scratch and internal APIs have change in incompatible
ways.
Diffstat (limited to 'src/bin/benchmark-index.rs')
-rw-r--r-- | src/bin/benchmark-index.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bin/benchmark-index.rs b/src/bin/benchmark-index.rs index 5008660..d49a6c3 100644 --- a/src/bin/benchmark-index.rs +++ b/src/bin/benchmark-index.rs @@ -1,4 +1,5 @@ use obnam::benchmark::ChunkGenerator; +use obnam::chunkmeta::ChunkMeta; use obnam::index::Index; use std::path::PathBuf; use structopt::StructOpt; @@ -24,9 +25,10 @@ fn main() -> anyhow::Result<()> { let opt = Opt::from_args(); let gen = ChunkGenerator::new(opt.num); - let mut index = Index::default(); + let mut index = Index::new(".")?; for (id, checksum, _, _) in gen { - index.insert(id, "sha25", &checksum); + let meta = ChunkMeta::new(&checksum); + index.insert_meta(id, meta)?; } Ok(()) |