PendingDeletes

open class PendingDeletes(val info: SegmentCommitInfo, initialLiveDocs: Bits? = null, liveDocsInitialized: Boolean = !info.hasDeletions())

This class handles accounting and applying pending deletes for live segment readers

Constructors

Link copied to clipboard
constructor(info: SegmentCommitInfo, initialLiveDocs: Bits? = null, liveDocsInitialized: Boolean = !info.hasDeletions())
constructor(reader: SegmentReader, info: SegmentCommitInfo)

Properties

Link copied to clipboard
Link copied to clipboard
open val hardLiveDocs: Bits?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun delete(docID: Int): Boolean

Marks a document as deleted in this segment and return true if a document got actually deleted or if the document was already deleted.

Link copied to clipboard
open fun dropChanges()

Resets the pending docs

Link copied to clipboard
open fun isFullyDeleted(readerIOSupplier: IOSupplier<CodecReader>): Boolean

Returns true iff the segment represented by this PendingDeletes is fully deleted

Link copied to clipboard

Returns true if we have to initialize this PendingDeletes before .delete; otherwise this PendingDeletes is ready to accept deletes. A PendingDeletes can be initialized by providing it a reader via .onNewReader.

Link copied to clipboard

Returns true if the given reader needs to be refreshed in order to see the latest deletes

Link copied to clipboard
open fun numDeletesToMerge(policy: MergePolicy, readerIOSupplier: IOSupplier<CodecReader>): Int
Link copied to clipboard
fun numDocs(): Int

Returns the number of live documents in this segment

Link copied to clipboard

Returns the number of pending deletes that are not written to disk.

Link copied to clipboard

Called for every field update for the given field at flush time

Link copied to clipboard
open fun onNewReader(reader: CodecReader, info: SegmentCommitInfo)

Called once a new reader is opened for this segment ie. when deletes or updates are applied.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
Link copied to clipboard

Writes the live docs to disk and returns true if any new docs were written.