final class ReadersAndUpdates
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
ReadersAndUpdates.MergedDocValues<DocValuesInstance extends DocValuesIterator>
This class merges the current on-disk DV with an incoming update DV instance and merges the two instances
giving the incoming update precedence in terms of values, in other words the values of the update always
wins over the on-disk version.
|
(package private) static class |
ReadersAndUpdates.MergeReader |
| Modifier and Type | Field and Description |
|---|---|
private int |
indexCreatedVersionMajor |
(package private) SegmentCommitInfo |
info |
private boolean |
isMerging |
private java.util.Map<java.lang.String,java.util.List<DocValuesFieldUpdates>> |
mergingDVUpdates |
private PendingDeletes |
pendingDeletes |
private java.util.Map<java.lang.String,java.util.List<DocValuesFieldUpdates>> |
pendingDVUpdates |
(package private) java.util.concurrent.atomic.AtomicLong |
ramBytesUsed |
private SegmentReader |
reader |
private java.util.Map<java.lang.String,java.lang.String> |
readerAttributes |
private java.util.concurrent.atomic.AtomicInteger |
refCount |
(package private) Sorter.DocMap |
sortMap |
| Constructor and Description |
|---|
ReadersAndUpdates(int indexCreatedVersionMajor,
SegmentCommitInfo info,
PendingDeletes pendingDeletes,
java.util.Map<java.lang.String,java.lang.String> readerAttributes) |
ReadersAndUpdates(int indexCreatedVersionMajor,
SegmentReader reader,
PendingDeletes pendingDeletes,
java.util.Map<java.lang.String,java.lang.String> readerAttributes)
Init from a previously opened SegmentReader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDVUpdate(DocValuesFieldUpdates update)
Adds a new resolved (meaning it maps docIDs to new values) doc values packet.
|
private boolean |
assertNoDupGen(java.util.List<DocValuesFieldUpdates> fieldUpdates,
DocValuesFieldUpdates update) |
private SegmentReader |
createNewReaderWithLatestLiveDocs(SegmentReader reader) |
void |
decRef() |
boolean |
delete(int docID) |
void |
dropChanges() |
void |
dropMergingUpdates()
Drops all merging updates.
|
void |
dropReaders() |
int |
getDelCount() |
Bits |
getHardLiveDocs()
Returns the live-docs bits excluding documents that are not live due to soft-deletes
|
private CodecReader |
getLatestReader() |
Bits |
getLiveDocs()
Returns a snapshot of the live docs.
|
java.util.Map<java.lang.String,java.util.List<DocValuesFieldUpdates>> |
getMergingDVUpdates() |
long |
getNumDVUpdates() |
SegmentReader |
getReader(IOContext context)
Returns a
SegmentReader. |
(package private) ReadersAndUpdates.MergeReader |
getReaderForMerge(IOContext context)
Returns a reader for merge, with the latest doc values updates and deletions.
|
SegmentReader |
getReadOnlyClone(IOContext context)
Returns a ref to a clone.
|
private void |
handleDVUpdates(FieldInfos infos,
Directory dir,
DocValuesFormat dvFormat,
SegmentReader reader,
java.util.Map<java.lang.Integer,java.util.Set<java.lang.String>> fieldFiles,
long maxDelGen,
InfoStream infoStream) |
void |
incRef() |
boolean |
isFullyDeleted() |
(package private) boolean |
isMerging() |
(package private) boolean |
keepFullyDeletedSegment(MergePolicy mergePolicy) |
(package private) int |
numDeletesToMerge(MergePolicy policy) |
int |
refCount() |
void |
release(SegmentReader sr) |
(package private) void |
setIsMerging() |
private void |
swapNewReaderWithLatestLiveDocs() |
java.lang.String |
toString() |
private java.util.Set<java.lang.String> |
writeFieldInfosGen(FieldInfos fieldInfos,
Directory dir,
FieldInfosFormat infosFormat) |
boolean |
writeFieldUpdates(Directory dir,
FieldInfos.FieldNumbers fieldNumbers,
long maxDelGen,
InfoStream infoStream) |
boolean |
writeLiveDocs(Directory dir) |
final SegmentCommitInfo info
private final java.util.concurrent.atomic.AtomicInteger refCount
private SegmentReader reader
private final PendingDeletes pendingDeletes
private final int indexCreatedVersionMajor
private boolean isMerging
private final java.util.Map<java.lang.String,java.util.List<DocValuesFieldUpdates>> pendingDVUpdates
private final java.util.Map<java.lang.String,java.util.List<DocValuesFieldUpdates>> mergingDVUpdates
Sorter.DocMap sortMap
final java.util.concurrent.atomic.AtomicLong ramBytesUsed
private final java.util.Map<java.lang.String,java.lang.String> readerAttributes
ReadersAndUpdates(int indexCreatedVersionMajor,
SegmentCommitInfo info,
PendingDeletes pendingDeletes,
java.util.Map<java.lang.String,java.lang.String> readerAttributes)
ReadersAndUpdates(int indexCreatedVersionMajor,
SegmentReader reader,
PendingDeletes pendingDeletes,
java.util.Map<java.lang.String,java.lang.String> readerAttributes)
throws java.io.IOException
NOTE: steals incoming ref from reader.
java.io.IOExceptionpublic void incRef()
public void decRef()
public int refCount()
public int getDelCount()
private boolean assertNoDupGen(java.util.List<DocValuesFieldUpdates> fieldUpdates, DocValuesFieldUpdates update)
public void addDVUpdate(DocValuesFieldUpdates update) throws java.io.IOException
java.io.IOExceptionpublic long getNumDVUpdates()
public SegmentReader getReader(IOContext context) throws java.io.IOException
SegmentReader.java.io.IOExceptionpublic void release(SegmentReader sr) throws java.io.IOException
java.io.IOExceptionpublic boolean delete(int docID)
throws java.io.IOException
java.io.IOExceptionpublic void dropReaders()
throws java.io.IOException
java.io.IOExceptionpublic SegmentReader getReadOnlyClone(IOContext context) throws java.io.IOException
java.io.IOExceptionint numDeletesToMerge(MergePolicy policy) throws java.io.IOException
java.io.IOExceptionprivate CodecReader getLatestReader() throws java.io.IOException
java.io.IOExceptionpublic Bits getLiveDocs()
public Bits getHardLiveDocs()
public void dropChanges()
public boolean writeLiveDocs(Directory dir) throws java.io.IOException
java.io.IOExceptionprivate void handleDVUpdates(FieldInfos infos, Directory dir, DocValuesFormat dvFormat, SegmentReader reader, java.util.Map<java.lang.Integer,java.util.Set<java.lang.String>> fieldFiles, long maxDelGen, InfoStream infoStream) throws java.io.IOException
java.io.IOExceptionprivate java.util.Set<java.lang.String> writeFieldInfosGen(FieldInfos fieldInfos, Directory dir, FieldInfosFormat infosFormat) throws java.io.IOException
java.io.IOExceptionpublic boolean writeFieldUpdates(Directory dir, FieldInfos.FieldNumbers fieldNumbers, long maxDelGen, InfoStream infoStream) throws java.io.IOException
java.io.IOExceptionprivate SegmentReader createNewReaderWithLatestLiveDocs(SegmentReader reader) throws java.io.IOException
java.io.IOExceptionprivate void swapNewReaderWithLatestLiveDocs()
throws java.io.IOException
java.io.IOExceptionvoid setIsMerging()
boolean isMerging()
ReadersAndUpdates.MergeReader getReaderForMerge(IOContext context) throws java.io.IOException
java.io.IOExceptionpublic void dropMergingUpdates()
public java.util.Map<java.lang.String,java.util.List<DocValuesFieldUpdates>> getMergingDVUpdates()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isFullyDeleted()
throws java.io.IOException
java.io.IOExceptionboolean keepFullyDeletedSegment(MergePolicy mergePolicy) throws java.io.IOException
java.io.IOException