pub struct SharedCompressorState {Show 22 fields
pub processed_bases: AtomicUsize,
pub processed_samples: AtomicUsize,
pub raw_contigs: Mutex<Vec<(String, String, Vec<u8>)>>,
pub verbosity: usize,
pub buffered_segments: Arc<Mutex<BufferedSegments>>,
pub splitters: Arc<Mutex<AHashSet<u64>>>,
pub bloom_splitters: Arc<Mutex<BloomFilter>>,
pub vv_splitters: Mutex<Vec<Vec<u64>>>,
pub v_candidate_kmers: Vec<u64>,
pub v_duplicated_kmers: Vec<u64>,
pub kmer_length: usize,
pub adaptive_mode: bool,
pub map_segments: Arc<Mutex<AHashMap<(u64, u64), u32>>>,
pub map_segments_terminators: Arc<Mutex<AHashMap<u64, Vec<u64>>>>,
pub concatenated_genomes: bool,
pub no_segments: Arc<Mutex<u32>>,
pub no_raw_groups: u32,
pub archive: Option<Arc<Mutex<Archive>>>,
pub v_segments: Arc<Mutex<Vec<Option<SegmentGroup>>>>,
pub collection: Option<Arc<Mutex<CollectionV3>>>,
pub aux_queue: Arc<BoundedPriorityQueue<Task>>,
pub working_queue: Mutex<Arc<BoundedPriorityQueue<Task>>>,
}Expand description
Shared state accessible to all worker threads
This matches C++ AGC’s shared variables captured by lambda (agc_compressor.cpp:1099):
- Atomic counters (processed_bases, processed_samples)
- Mutexes for shared collections (v_raw_contigs, vv_fallback_minimizers, etc.)
- Archive writer, collection descriptor, etc.
Fields§
§processed_bases: AtomicUsizeTotal bases processed (for progress tracking)
processed_samples: AtomicUsizeNumber of samples processed (for progress tracking)
raw_contigs: Mutex<Vec<(String, String, Vec<u8>)>>Contigs that failed to compress well (need adaptive splitters) Matches C++ AGC’s v_raw_contigs (protected by mtx_raw_contigs)
verbosity: usizeVerbosity level (0 = quiet, 1 = normal, 2 = verbose)
buffered_segments: Arc<Mutex<BufferedSegments>>Buffered segments (KNOWN + NEW) Matches C++ AGC’s CBufferedSegPart buffered_seg_part
splitters: Arc<Mutex<AHashSet<u64>>>Splitter k-mers (exact set) Matches C++ AGC’s hs_splitters
bloom_splitters: Arc<Mutex<BloomFilter>>Bloom filter for splitters (fast probabilistic check) Matches C++ AGC’s bloom_splitters
vv_splitters: Mutex<Vec<Vec<u64>>>Per-thread vectors for accumulating new splitters (adaptive mode) Matches C++ AGC’s vv_splitters (agc_compressor.h:721) Each worker thread accumulates splitters, then merges at barrier
v_candidate_kmers: Vec<u64>Reference genome singleton k-mers (for adaptive mode exclusion) Matches C++ AGC’s v_candidate_kmers (agc_compressor.h:708) Sorted for efficient set_difference operations
v_duplicated_kmers: Vec<u64>Reference genome duplicated k-mers (for adaptive mode exclusion) Matches C++ AGC’s v_duplicated_kmers (agc_compressor.h:710) Sorted for efficient set_difference operations
kmer_length: usizeK-mer length for segmentation
adaptive_mode: boolAdaptive compression mode (find new splitters for hard contigs)
map_segments: Arc<Mutex<AHashMap<(u64, u64), u32>>>Map: (kmer1, kmer2) → group_id Matches C++ AGC’s map_segments Lower group_id wins when same (k1, k2) pair (earlier samples are reference)
map_segments_terminators: Arc<Mutex<AHashMap<u64, Vec<u64>>>>Map: kmer → Vec
concatenated_genomes: boolConcatenated genomes mode (treat all contigs as one sample)
no_segments: Arc<Mutex<u32>>Total number of segment groups (assigned group IDs) Matches C++ AGC’s no_segments
no_raw_groups: u32Number of raw groups (groups without LZ encoding) Matches C++ AGC’s no_raw_groups
archive: Option<Arc<Mutex<Archive>>>Archive writer for segment output Matches C++ AGC’s out_archive
v_segments: Arc<Mutex<Vec<Option<SegmentGroup>>>>Segment groups indexed by group_id Matches C++ AGC’s v_segments (vector<CSegment*>) Lazily created when first segment arrives for that group
collection: Option<Arc<Mutex<CollectionV3>>>Collection metadata for samples/contigs/segments Matches C++ AGC’s collection_desc
aux_queue: Arc<BoundedPriorityQueue<Task>>Auxiliary queue for adaptive mode (re-enqueue hard contigs) Matches C++ AGC’s pq_contigs_desc_aux
working_queue: Mutex<Arc<BoundedPriorityQueue<Task>>>Working queue pointer (switches between main and aux) Matches C++ AGC’s pq_contigs_desc_working
Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more