Document architecture redesign and add partition layer accessor
Documents a proposed redesign for cross-partition batch resolution, shifting trigger logic to per-destination accumulator thresholds and introducing entropy-based pruning criteria. Adds an `n_layers_per_partition` method to the index, exposing partition metadata with consistent error handling and clarified documentation regarding build-time structural properties.
This commit is contained in:
@@ -142,6 +142,19 @@ impl KmerIndex {
|
||||
pub fn minimizer_size(&self) -> usize { self.meta.config.minimizer_size }
|
||||
pub fn n_partitions(&self) -> usize { self.partition.n_partitions() }
|
||||
|
||||
/// Number of layers per partition.
|
||||
///
|
||||
/// Structural property of the index, fixed at build time and
|
||||
/// homogeneous across all partitions — reading it off partition 0
|
||||
/// is enough, no need to scan every partition.
|
||||
pub fn n_layers_per_partition(&self) -> OKIResult<usize> {
|
||||
use obilayeredmap::meta::PartitionMeta;
|
||||
let index_dir = self.partition.part_dir(0).join("index");
|
||||
let meta = PartitionMeta::load(&index_dir)
|
||||
.map_err(|e| OKIError::Io(std::io::Error::new(std::io::ErrorKind::Other, e.to_string())))?;
|
||||
Ok(meta.n_layers)
|
||||
}
|
||||
|
||||
/// Expose the inner partition so the caller can run scatter into it.
|
||||
/// Call `mark_scattered` once scatter is complete.
|
||||
pub fn partition_mut(&mut self) -> &mut KmerPartition {
|
||||
|
||||
Reference in New Issue
Block a user