final class FrozenBufferedUpdates
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
FrozenBufferedUpdates.TermDocsIterator
This class helps iterating a term dictionary and consuming all the docs for each terms.
|
Modifier and Type | Field and Description |
---|---|
java.util.concurrent.CountDownLatch |
applied
Counts down once all deletes/updates have been applied
|
private java.util.concurrent.locks.ReentrantLock |
applyLock |
(package private) static int |
BYTES_PER_DEL_QUERY |
(package private) int |
bytesUsed |
(package private) Query[] |
deleteQueries |
(package private) int[] |
deleteQueryLimits |
(package private) PrefixCodedTerms |
deleteTerms |
private long |
delGen |
private java.util.Map<java.lang.String,FieldUpdatesBuffer> |
fieldUpdates |
private int |
fieldUpdatesCount |
private InfoStream |
infoStream |
(package private) int |
numTermDeletes |
(package private) SegmentCommitInfo |
privateSegment |
long |
totalDelCount
How many total documents were deleted/updated.
|
Constructor and Description |
---|
FrozenBufferedUpdates(InfoStream infoStream,
BufferedUpdates updates,
SegmentCommitInfo privateSegment) |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
any() |
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,
java.util.Map<java.lang.String,FieldUpdatesBuffer> updates,
long delGen,
boolean segmentPrivateDeletes) |
private long |
applyQueryDeletes(BufferedUpdatesStream.SegmentState[] segStates) |
private long |
applyTermDeletes(BufferedUpdatesStream.SegmentState[] segStates) |
static BufferedUpdatesStream.ApplyDeletesResult |
closeSegmentStates(IndexWriter writer,
BufferedUpdatesStream.SegmentState[] segStates,
boolean success)
Close segment states previously opened with openSegmentStates.
|
long |
delGen() |
private void |
finishApply(IndexWriter writer,
BufferedUpdatesStream.SegmentState[] segStates,
boolean success,
java.util.Set<java.lang.String> delFiles) |
(package private) void |
forceApply(IndexWriter writer)
Translates a frozen packet of delete term/query, or doc values
updates, into their actual docIDs in the index, and applies the change.
|
private java.util.List<SegmentCommitInfo> |
getInfosToApply(IndexWriter writer)
Returns the
SegmentCommitInfo that this packet is supposed to apply its deletes to, or null
if the private segment was already merged away. |
private static BufferedUpdatesStream.SegmentState[] |
openSegmentStates(IndexWriter writer,
java.util.List<SegmentCommitInfo> infos,
java.util.Set<SegmentCommitInfo> alreadySeenSegments,
long delGen)
Opens SegmentReader and inits SegmentState for each segment.
|
void |
setDelGen(long delGen) |
java.lang.String |
toString() |
(package private) boolean |
tryApply(IndexWriter writer)
Translates a frozen packet of delete term/query, or doc values
updates, into their actual docIDs in the index, and applies the change.
|
static final int BYTES_PER_DEL_QUERY
final PrefixCodedTerms deleteTerms
final Query[] deleteQueries
final int[] deleteQueryLimits
public final java.util.concurrent.CountDownLatch applied
private final java.util.concurrent.locks.ReentrantLock applyLock
private final java.util.Map<java.lang.String,FieldUpdatesBuffer> fieldUpdates
public long totalDelCount
private final int fieldUpdatesCount
final int bytesUsed
final int numTermDeletes
private long delGen
final SegmentCommitInfo privateSegment
private final InfoStream infoStream
public FrozenBufferedUpdates(InfoStream infoStream, BufferedUpdates updates, SegmentCommitInfo privateSegment)
private java.util.List<SegmentCommitInfo> getInfosToApply(IndexWriter writer)
SegmentCommitInfo
that this packet is supposed to apply its deletes to, or null
if the private segment was already merged away.boolean tryApply(IndexWriter writer) throws java.io.IOException
forceApply(IndexWriter)
must be called.java.io.IOException
void forceApply(IndexWriter writer) throws java.io.IOException
java.io.IOException
private static BufferedUpdatesStream.SegmentState[] openSegmentStates(IndexWriter writer, java.util.List<SegmentCommitInfo> infos, java.util.Set<SegmentCommitInfo> alreadySeenSegments, long delGen) throws java.io.IOException
java.io.IOException
public static BufferedUpdatesStream.ApplyDeletesResult closeSegmentStates(IndexWriter writer, BufferedUpdatesStream.SegmentState[] segStates, boolean success) throws java.io.IOException
java.io.IOException
private void finishApply(IndexWriter writer, BufferedUpdatesStream.SegmentState[] segStates, boolean success, java.util.Set<java.lang.String> delFiles) throws java.io.IOException
java.io.IOException
private long apply(BufferedUpdatesStream.SegmentState[] segStates) throws java.io.IOException
java.io.IOException
private long applyDocValuesUpdates(BufferedUpdatesStream.SegmentState[] segStates) throws java.io.IOException
java.io.IOException
private static long applyDocValuesUpdates(BufferedUpdatesStream.SegmentState segState, java.util.Map<java.lang.String,FieldUpdatesBuffer> updates, long delGen, boolean segmentPrivateDeletes) throws java.io.IOException
java.io.IOException
private long applyQueryDeletes(BufferedUpdatesStream.SegmentState[] segStates) throws java.io.IOException
java.io.IOException
private long applyTermDeletes(BufferedUpdatesStream.SegmentState[] segStates) throws java.io.IOException
java.io.IOException
public void setDelGen(long delGen)
public long delGen()
public java.lang.String toString()
toString
in class java.lang.Object
boolean any()