DocumentsWriterFlushControl
This class controls DocumentsWriterPerThread flushing during indexing. It tracks the memory consumption per DocumentsWriterPerThread and uses a configured FlushPolicy to decide if a DocumentsWriterPerThread must flush.
In addition to the FlushPolicy the flush control might set certain [ ] as flush pending iff a DocumentsWriterPerThread exceeds the IndexWriterConfig.rAMPerThreadHardLimitMB to prevent address space exhaustion.
Properties
Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).
Bytes used by buffered deletes.
Returns true if a full flush is currently running
Functions
Returns true iff stalled
Returns the largest non-pending flushable DWPT or null if there is none.
Notify flush policy that a delete-only operation occurred.
Atomically get and reset the apply-all-deletes flag.
Check whether deletes need to be applied. This can be used as a pre-flight check before calling .getAndResetApplyAllDeletes to make sure that a single thread applies deletes.
Returns the IndexWriter
Retrieve next pending DWPT to flush, if any (typically during full flush).
Returns the number of flushes that are checked out but not yet available for flushing. This only applies during a full flush if a DWPT needs flushing but must not be flushed until the full flush has finished.
Returns the number of DWPTs currently marked as flushing (in-flight).
Returns the number of flushes that are already checked out but not yet actively flushing
Return the memory usage of this object in bytes. Negative values are illegal.
Sets flush pending state on the given DocumentsWriterPerThread. The [ ] must have indexed at least on Document and must not be already pending.
This method will block if too many DWPT are currently flushing and no checked out DWPT are available