Skip to content

Commit

Permalink
bork bork
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Aug 18, 2024
1 parent 08459a8 commit 644ffe2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/core/src/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use crate::encodings::Idx;
use crate::manifest::{Manifest, Record};
use crate::prelude::*;
use crate::storage::{FSStorage, InnerStorage, MemStorage, SigStore, ZipStorage};
#[cfg(all(feature = "branchwater", not(target_arch = "wasm32")))]
use crate::storage::rocksdb::RocksDBStorage;
use crate::{Error, Result};

#[cfg(feature = "parallel")]
Expand Down Expand Up @@ -132,6 +134,18 @@ impl Collection {
storage: InnerStorage::new(storage),
})
}
#[cfg(all(feature = "branchwater", not(target_arch = "wasm32")))]
pub fn from_rocksdb<P: AsRef<Path>>(dirname: P) -> Result<Self> {

Check warning on line 138 in src/core/src/collection.rs

View check run for this annotation

Codecov / codecov/patch

src/core/src/collection.rs#L138

Added line #L138 was not covered by tests
// @CTB: is this right?
let path = dirname.as_ref().as_os_str().to_str().unwrap();
let storage = RocksDBStorage::from_path(path);

Check warning on line 141 in src/core/src/collection.rs

View check run for this annotation

Codecov / codecov/patch

src/core/src/collection.rs#L140-L141

Added lines #L140 - L141 were not covered by tests
// Load manifest from standard location in zipstorage
let manifest = Manifest::from_reader(storage.load("SOURMASH-MANIFEST.csv")?.as_slice())?;
Ok(Self {
manifest,
storage: InnerStorage::new(storage),

Check warning on line 146 in src/core/src/collection.rs

View check run for this annotation

Codecov / codecov/patch

src/core/src/collection.rs#L143-L146

Added lines #L143 - L146 were not covered by tests
})
}

pub fn from_sigs(sigs: Vec<Signature>) -> Result<Self> {
let storage = MemStorage::new();
Expand Down

0 comments on commit 644ffe2

Please sign in to comment.