use std::sync::atomic::AtomicBool; use std::sync::Arc; use grenad::CompressionType; use rayon::ThreadPool; #[derive(Debug)] pub struct IndexerConfig { pub log_every_n: Option, pub max_nb_chunks: Option, pub documents_chunk_size: Option, pub max_memory: Option, pub chunk_compression_type: CompressionType, pub chunk_compression_level: Option, pub thread_pool: Option, /// Set to true if the thread pool catched a panic /// and we must abort the task pub pool_panic_catched: Arc, pub max_positions_per_attributes: Option, pub skip_index_budget: bool, } impl Default for IndexerConfig { fn default() -> Self { Self { log_every_n: None, max_nb_chunks: None, documents_chunk_size: None, max_memory: None, chunk_compression_type: CompressionType::None, chunk_compression_level: None, thread_pool: None, pool_panic_catched: Arc::default(), max_positions_per_attributes: None, skip_index_budget: false, } } }