C# Класс Lucene.Net.Index.DocumentsWriterDeleteQueue

DocumentsWriterDeleteQueue is a non-blocking linked pending deletes queue. In contrast to other queue implementation we only maintain the tail of the queue. A delete queue is always used in a context of a set of DWPTs and a global delete pool. Each of the DWPT and the global pool need to maintain their 'own' head of the queue (as a DeleteSlice instance per DWPT). The difference between the DWPT and the global pool is that the DWPT starts maintaining a head once it has added its first document since for its segments private deletes only the deletes after that document are relevant. The global pool instead starts maintaining the head once this instance is created by taking the sentinel instance as its initial head.

Since each DeleteSlice maintains its own head and the list is only single linked the garbage collector takes care of pruning the list for us. All nodes in the list that are still relevant should be either directly or indirectly referenced by one of the DWPT's private DeleteSlice or by the global BufferedUpdates slice.

Each DWPT as well as the global delete pool maintain their private DeleteSlice instance. In the DWPT case updating a slice is equivalent to atomically finishing the document. The slice update guarantees a "happens before" relationship to all other updates in the same indexing session. When a DWPT updates a document it:

  1. consumes a document and finishes its processing
  2. updates its private DeleteSlice either by calling #updateSlice(DeleteSlice) or #add(Term, DeleteSlice) (if the document has a delTerm)
  3. applies all deletes in the slice to its private BufferedUpdates and resets it
  4. increments its internal document id
The DWPT also doesn't apply its current documents delete term until it has updated its delete slice which ensures the consistency of the update. If the update fails before the DeleteSlice could have been updated the deleteTerm will also not be added to its private deletes neither to the global deletes.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Add ( Lucene.Net.Index.Term term, DeleteSlice slice ) : void

invariant for document update

AddDelete ( ) : void
AnyChanges ( ) : bool
BytesUsed ( ) : long
Clear ( ) : void
DocumentsWriterDeleteQueue ( ) : Lucene.Net.Support
DocumentsWriterDeleteQueue ( BufferedUpdates globalBufferedUpdates, long generation ) : Lucene.Net.Support
DocumentsWriterDeleteQueue ( long generation ) : Lucene.Net.Support
FreezeGlobalBuffer ( DeleteSlice callerSlice ) : FrozenBufferedUpdates
NewSlice ( ) : DeleteSlice
NumGlobalTermDeletes ( ) : int
ToString ( ) : string
TryApplyGlobalSlice ( ) : void
UpdateSlice ( DeleteSlice slice ) : bool

Приватные методы

Метод Описание
Add ( Node item ) : void
AddBinaryUpdate ( BinaryDocValuesUpdate update ) : void
AddNumericUpdate ( NumericDocValuesUpdate update ) : void
ForceApplyGlobalSlice ( ) : bool

Описание методов

Add() публичный Метод

invariant for document update
public Add ( Lucene.Net.Index.Term term, DeleteSlice slice ) : void
term Lucene.Net.Index.Term
slice DeleteSlice
Результат void

AddDelete() публичный Метод

public AddDelete ( ) : void
Результат void

AnyChanges() публичный Метод

public AnyChanges ( ) : bool
Результат bool

BytesUsed() публичный Метод

public BytesUsed ( ) : long
Результат long

Clear() публичный Метод

public Clear ( ) : void
Результат void

DocumentsWriterDeleteQueue() публичный Метод

public DocumentsWriterDeleteQueue ( ) : Lucene.Net.Support
Результат Lucene.Net.Support

DocumentsWriterDeleteQueue() публичный Метод

public DocumentsWriterDeleteQueue ( BufferedUpdates globalBufferedUpdates, long generation ) : Lucene.Net.Support
globalBufferedUpdates BufferedUpdates
generation long
Результат Lucene.Net.Support

DocumentsWriterDeleteQueue() публичный Метод

public DocumentsWriterDeleteQueue ( long generation ) : Lucene.Net.Support
generation long
Результат Lucene.Net.Support

FreezeGlobalBuffer() публичный Метод

public FreezeGlobalBuffer ( DeleteSlice callerSlice ) : FrozenBufferedUpdates
callerSlice DeleteSlice
Результат FrozenBufferedUpdates

NewSlice() публичный Метод

public NewSlice ( ) : DeleteSlice
Результат DeleteSlice

NumGlobalTermDeletes() публичный Метод

public NumGlobalTermDeletes ( ) : int
Результат int

ToString() публичный Метод

public ToString ( ) : string
Результат string

TryApplyGlobalSlice() публичный Метод

public TryApplyGlobalSlice ( ) : void
Результат void

UpdateSlice() публичный Метод

public UpdateSlice ( DeleteSlice slice ) : bool
slice DeleteSlice
Результат bool