java.lang.Object
org.apache.lucene.index.FrozenBufferedUpdates
Holds buffered deletes and updates by term or query, once pushed. Pushed deletes/updates are
write-once, so we shift to more memory efficient data structure to hold them. We don't hold
docIDs because these are applied on flush.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classThis class helps iterating a term dictionary and consuming all the docs for each terms. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal CountDownLatchCounts down once all deletes/updates have been appliedprivate final ReentrantLock(package private) static final int(package private) final int(package private) final Query[](package private) final int[](package private) final PrefixCodedTermsprivate longprivate final Map<String, FieldUpdatesBuffer> private final intprivate final InfoStream(package private) final SegmentCommitInfolongHow many total documents were deleted/updated. -
Constructor Summary
ConstructorsConstructorDescriptionFrozenBufferedUpdates(InfoStream infoStream, BufferedUpdates updates, SegmentCommitInfo privateSegment) -
Method Summary
Modifier and TypeMethodDescription(package private) booleanany()(package private) longapply(BufferedUpdatesStream.SegmentState[] segStates) Applies pending delete-by-term, delete-by-query and doc values updates to all segments in the index, returning the number of new deleted or updated documents.private longapplyDocValuesUpdates(BufferedUpdatesStream.SegmentState[] segStates) private static longapplyDocValuesUpdates(BufferedUpdatesStream.SegmentState segState, Map<String, FieldUpdatesBuffer> updates, long delGen, boolean segmentPrivateDeletes) private longapplyQueryDeletes(BufferedUpdatesStream.SegmentState[] segStates) private longapplyTermDeletes(BufferedUpdatesStream.SegmentState[] segStates) longdelGen()(package private) booleanReturns true iff this buffered updates instance was already applied(package private) voidlock()locks this buffered update instancevoidsetDelGen(long delGen) toString()(package private) booleantryLock()Tries to lock this buffered update instance(package private) voidunlock()Releases the lock of this buffered update instance
-
Field Details
-
BYTES_PER_DEL_QUERY
static final int BYTES_PER_DEL_QUERY -
deleteTerms
-
deleteQueries
-
deleteQueryLimits
final int[] deleteQueryLimits -
applied
Counts down once all deletes/updates have been applied -
applyLock
-
fieldUpdates
-
totalDelCount
public long totalDelCountHow many total documents were deleted/updated. -
fieldUpdatesCount
private final int fieldUpdatesCount -
bytesUsed
final int bytesUsed -
delGen
private long delGen -
privateSegment
-
infoStream
-
-
Constructor Details
-
FrozenBufferedUpdates
public FrozenBufferedUpdates(InfoStream infoStream, BufferedUpdates updates, SegmentCommitInfo privateSegment)
-
-
Method Details
-
tryLock
boolean tryLock()Tries to lock this buffered update instance- Returns:
- true if the lock was successfully acquired. otherwise false.
-
lock
void lock()locks this buffered update instance -
unlock
void unlock()Releases the lock of this buffered update instance -
isApplied
boolean isApplied()Returns true iff this buffered updates instance was already applied -
apply
Applies pending delete-by-term, delete-by-query and doc values updates to all segments in the index, returning the number of new deleted or updated documents.- Throws:
IOException
-
applyDocValuesUpdates
private long applyDocValuesUpdates(BufferedUpdatesStream.SegmentState[] segStates) throws IOException - Throws:
IOException
-
applyDocValuesUpdates
private static long applyDocValuesUpdates(BufferedUpdatesStream.SegmentState segState, Map<String, FieldUpdatesBuffer> updates, long delGen, boolean segmentPrivateDeletes) throws IOException- Throws:
IOException
-
applyQueryDeletes
- Throws:
IOException
-
applyTermDeletes
- Throws:
IOException
-
setDelGen
public void setDelGen(long delGen) -
delGen
public long delGen() -
toString
-
any
boolean any()
-