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 class
This class helps iterating a term dictionary and consuming all the docs for each terms. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal CountDownLatch
Counts 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 PrefixCodedTerms
private long
private final Map<String,
FieldUpdatesBuffer> private final int
private final InfoStream
(package private) final SegmentCommitInfo
long
How many total documents were deleted/updated. -
Constructor Summary
ConstructorsConstructorDescriptionFrozenBufferedUpdates
(InfoStream infoStream, BufferedUpdates updates, SegmentCommitInfo privateSegment) -
Method Summary
Modifier and TypeMethodDescription(package private) boolean
any()
(package private) long
apply
(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 long
applyDocValuesUpdates
(BufferedUpdatesStream.SegmentState[] segStates) private static long
applyDocValuesUpdates
(BufferedUpdatesStream.SegmentState segState, Map<String, FieldUpdatesBuffer> updates, long delGen, boolean segmentPrivateDeletes) private long
applyQueryDeletes
(BufferedUpdatesStream.SegmentState[] segStates) private long
applyTermDeletes
(BufferedUpdatesStream.SegmentState[] segStates) long
delGen()
(package private) boolean
Returns true iff this buffered updates instance was already applied(package private) void
lock()
locks this buffered update instancevoid
setDelGen
(long delGen) toString()
(package private) boolean
tryLock()
Tries to lock this buffered update instance(package private) void
unlock()
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()
-