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.

Constructors

Link copied to clipboard
constructor(documentsWriter: DocumentsWriter, config: LiveIndexWriterConfig)

Properties

Link copied to clipboard

Returns nested resources of this class. The result should be a point-in-time snapshot (to avoid race conditions).

Link copied to clipboard

Bytes used by buffered deletes.

Link copied to clipboard
Link copied to clipboard

Returns true if a full flush is currently running

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns true iff stalled

Link copied to clipboard
Link copied to clipboard

Returns the largest non-pending flushable DWPT or null if there is none.

Link copied to clipboard
open override fun close()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Notify flush policy that a delete-only operation occurred.

Link copied to clipboard
Link copied to clipboard

Atomically get and reset the apply-all-deletes flag.

Link copied to clipboard

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.

Link copied to clipboard
Link copied to clipboard
suspend fun markForFullFlush(): Long
Link copied to clipboard
fun netBytes(): Long
Link copied to clipboard

Retrieve next pending DWPT to flush, if any (typically during full flush).

Link copied to clipboard

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.

Link copied to clipboard

Returns the number of DWPTs currently marked as flushing (in-flight).

Link copied to clipboard

Returns the number of flushes that are already checked out but not yet actively flushing

Link copied to clipboard
Link copied to clipboard
open override fun ramBytesUsed(): Long

Return the memory usage of this object in bytes. Negative values are illegal.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Sets flush pending state on the given DocumentsWriterPerThread. The [ ] must have indexed at least on Document and must not be already pending.

Link copied to clipboard
Link copied to clipboard

This method will block if too many DWPT are currently flushing and no checked out DWPT are available