mod enumerate;
mod holder;
mod lifecycle;
mod load;
mod refresh;
mod shard_read;
#[cfg(test)]
mod tests;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use parking_lot::RwLock;
use crate::segment::data_types::load_profile::LoadProfile;
use crate::segment::index::UniversalReadExt;
use crate::edge::EdgeConfig;
pub use crate::edge::read_only::enumerate::{
LocalSegmentEnumerator, ManifestSegmentEnumerator, SegmentEnumerator,
};
use crate::edge::read_only::holder::ReadOnlySegmentHolder;
pub struct ReadOnlyEdgeShard<S: UniversalReadExt + 'static> {
path: PathBuf,
fs: S::Fs,
config: RwLock<Arc<EdgeConfig>>,
segments: RwLock<ReadOnlySegmentHolder<S>>,
enumerator: Box<dyn SegmentEnumerator>,
search_pool: Arc<rayon::ThreadPool>,
load_profile: Option<LoadProfile>,
}
impl<S: UniversalReadExt + 'static> ReadOnlyEdgeShard<S> {
pub fn path(&self) -> &Path {
&self.path
}
pub fn segments_count(&self) -> usize {
self.segments.read().uuids().len()
}
}