mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-06-19 09:16:45 +00:00
Merge 19ab1418a8 into c096b2ad89
This commit is contained in:
commit
fc7e498c95
2 changed files with 11 additions and 0 deletions
|
|
@ -349,6 +349,12 @@ impl<D: Document> IndexWriter<D> {
|
|||
&self.index
|
||||
}
|
||||
|
||||
/// Check if there are any merging threads
|
||||
/// Does not block
|
||||
pub fn has_merging_threads(&self) -> bool {
|
||||
self.segment_updater.has_merging_threads()
|
||||
}
|
||||
|
||||
/// If there are some merging threads, blocks until they all finish their work and
|
||||
/// then drop the `IndexWriter`.
|
||||
pub fn wait_merging_threads(mut self) -> crate::Result<()> {
|
||||
|
|
|
|||
|
|
@ -676,6 +676,11 @@ impl SegmentUpdater {
|
|||
Ok(after_merge_segment_meta)
|
||||
}
|
||||
|
||||
/// Check if there are still pending merges without blocking
|
||||
pub fn has_merging_threads(&self) -> bool {
|
||||
self.merge_operations.len() > 0
|
||||
}
|
||||
|
||||
/// Wait for current merging threads.
|
||||
///
|
||||
/// Upon termination of the current merging threads,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue