diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-05-24 08:55:14 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-05-29 11:41:15 +0300 |
commit | 6de230c382a4329df00bc11cc1ffb90390b13159 (patch) | |
tree | d4f0668be0d5cd07ea32af2b0978696658532122 /src/bin/benchmark-indexedstore.rs | |
parent | 566dd94d2e46c489b50d84a1fd24683460e5cfdc (diff) | |
download | obnam2-6de230c382a4329df00bc11cc1ffb90390b13159.tar.gz |
refactor: make metadata be part of datachunk
This makes it harder to lose the metadata for a chunk, or to use
unrelated metadata and chunk. Also, soon I will refactor things for
encrypting chunks, which will need metadata embedded in the encrypted
chunk.
Sponsored-by: author
Diffstat (limited to 'src/bin/benchmark-indexedstore.rs')
-rw-r--r-- | src/bin/benchmark-indexedstore.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/benchmark-indexedstore.rs b/src/bin/benchmark-indexedstore.rs index acc3bd3..5cd3ff1 100644 --- a/src/bin/benchmark-indexedstore.rs +++ b/src/bin/benchmark-indexedstore.rs @@ -60,8 +60,8 @@ fn create(chunks: &Path, num: u32) -> anyhow::Result<()> { let mut store = IndexedStore::new(chunks)?; let gen = ChunkGenerator::new(num); - for (_, _, meta, chunk) in gen { - store.save(&meta, &chunk)?; + for (_, _, chunk) in gen { + store.save(&chunk)?; } Ok(()) @@ -82,8 +82,8 @@ fn lookup(index: &mut IndexedStore, num: u32) -> anyhow::Result<()> { loop { let gen = ChunkGenerator::new(num); - for (_, _, meta, _) in gen { - index.find_by_sha256(&meta.sha256())?; + for (_, _, chunk) in gen { + index.find_by_sha256(&chunk.meta().sha256())?; done += 1; if done >= num { return Ok(()); |