DocumentsWriterPerThread

class DocumentsWriterPerThread(indexMajorVersionCreated: Int, segmentName: String, directoryOrig: Directory, directory: Directory, indexWriterConfig: LiveIndexWriterConfig, val deleteQueue: DocumentsWriterDeleteQueue, fieldInfos: FieldInfos.Builder, pendingNumDocs: AtomicLong, enableTestPoints: Boolean) : Accountable, Lock

Constructors

Link copied to clipboard
constructor(indexMajorVersionCreated: Int, segmentName: String, directoryOrig: Directory, directory: Directory, indexWriterConfig: LiveIndexWriterConfig, deleteQueue: DocumentsWriterDeleteQueue, fieldInfos: FieldInfos.Builder, pendingNumDocs: AtomicLong, enableTestPoints: Boolean)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class FlushedSegment(infoStream: InfoStream, val segmentInfo: SegmentCommitInfo, val fieldInfos: FieldInfos, segmentUpdates: BufferedUpdates?, val liveDocs: FixedBitSet?, val delCount: Int, val sortMap: Sorter.DocMap?)

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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the last committed bytes for this DWPT. This method can be called without acquiring the DWPTs lock.

Link copied to clipboard

Returns the number of RAM resident documents in this DocumentsWriterPerThread

Functions

Link copied to clipboard
fun abort()

Called if we hit an exception at a bad time (when updating the index files) and must discard all currently buffered docs. This resets our state, discarding any docs added since last flush.

Link copied to clipboard

Commits the current .ramBytesUsed and stores its value for later reuse. The last committed bytes used can be retrieved via .getLastCommittedBytesUsed

Link copied to clipboard

Flush all pending docs to a new segment

Link copied to clipboard

Get current segment info we are writing.

Link copied to clipboard

Returns true iff this DWPT has been flushed

Link copied to clipboard

Returns true iff this DWPT is marked as flush pending

Link copied to clipboard
open override fun lock()

Acquires the lock.

Link copied to clipboard
open override fun lockInterruptibly()

Acquires the lock unless the current thread is interrupted.

Link copied to clipboard
open override fun newCondition(): Condition

Returns a new Condition instance that is bound to this Lock instance.

Link copied to clipboard
Link copied to clipboard

Prepares this DWPT for flushing. This method will freeze and return the [ ]s global buffer and apply all pending deletes to this DWPT.

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

Seals the SegmentInfo for the new flushed segment and persists the deleted documents FixedBitSet.

Link copied to clipboard

Sets this DWPT as flush pending. This can only be set once.

Link copied to clipboard
fun testPoint(message: String)
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun tryLock(): Boolean

Acquires the lock only if it is free at the time of invocation.

open override fun tryLock(time: Long, unit: TimeUnit): Boolean

Acquires the lock if it is free within the given waiting time and the current thread has not been interrupted.

Link copied to clipboard
open override fun unlock()

Releases the lock.

Link copied to clipboard
fun updateDocuments(docs: Iterable<out Iterable<out IndexableField>>, deleteNode: DocumentsWriterDeleteQueue.Node<*>?, flushNotifications: DocumentsWriter.FlushNotifications, onNewDocOnRAM: Runnable): Long