final class PendingSoftDeletes extends PendingDeletes
| Modifier and Type | Field and Description |
|---|---|
private long |
dvGeneration |
private java.lang.String |
field |
private PendingDeletes |
hardDeletes |
info, liveDocsInitialized, pendingDeleteCount| Constructor and Description |
|---|
PendingSoftDeletes(java.lang.String field,
SegmentCommitInfo info) |
PendingSoftDeletes(java.lang.String field,
SegmentReader reader,
SegmentCommitInfo info) |
| Modifier and Type | Method and Description |
|---|---|
(package private) static int |
applySoftDeletes(DocIdSetIterator iterator,
FixedBitSet bits)
Clears all bits in the given bitset that are set and are also in the given DocIdSetIterator.
|
private boolean |
assertPendingDeletes() |
(package private) static int |
countSoftDeletes(DocIdSetIterator softDeletedDocs,
Bits hardDeletes) |
(package private) boolean |
delete(int docID)
Marks a document as deleted in this segment and return true if a document got actually deleted or
if the document was already deleted.
|
(package private) void |
dropChanges()
Resets the pending docs
|
private void |
ensureInitialized(IOSupplier<CodecReader> readerIOSupplier) |
(package private) Bits |
getHardLiveDocs()
Returns a snapshot of the hard live docs.
|
(package private) boolean |
isFullyDeleted(IOSupplier<CodecReader> readerIOSupplier)
Returns
true iff the segment represented by this PendingDeletes is fully deleted |
(package private) boolean |
mustInitOnDelete()
Returns
true if we have to initialize this PendingDeletes before PendingDeletes.delete(int);
otherwise this PendingDeletes is ready to accept deletes. |
(package private) int |
numDeletesToMerge(MergePolicy policy,
IOSupplier<CodecReader> readerIOSupplier) |
protected int |
numPendingDeletes()
Returns the number of pending deletes that are not written to disk.
|
(package private) void |
onDocValuesUpdate(FieldInfo info,
DocValuesFieldUpdates.Iterator iterator)
Called for every field update for the given field at flush time
|
(package private) void |
onNewReader(CodecReader reader,
SegmentCommitInfo info)
Called once a new reader is opened for this segment ie.
|
private FieldInfos |
readFieldInfos() |
java.lang.String |
toString() |
(package private) boolean |
writeLiveDocs(Directory dir)
Writes the live docs to disk and returns
true if any new docs were written. |
getDelCount, getLiveDocs, getMutableBits, needsRefresh, numDocs, verifyDocCountsprivate final java.lang.String field
private long dvGeneration
private final PendingDeletes hardDeletes
PendingSoftDeletes(java.lang.String field,
SegmentCommitInfo info)
PendingSoftDeletes(java.lang.String field,
SegmentReader reader,
SegmentCommitInfo info)
boolean delete(int docID)
throws java.io.IOException
PendingDeletesdelete in class PendingDeletesjava.io.IOExceptionprotected int numPendingDeletes()
PendingDeletesnumPendingDeletes in class PendingDeletesvoid onNewReader(CodecReader reader, SegmentCommitInfo info) throws java.io.IOException
PendingDeletesonNewReader in class PendingDeletesjava.io.IOExceptionboolean writeLiveDocs(Directory dir) throws java.io.IOException
PendingDeletestrue if any new docs were written.writeLiveDocs in class PendingDeletesjava.io.IOExceptionvoid dropChanges()
PendingDeletesdropChanges in class PendingDeletesstatic int applySoftDeletes(DocIdSetIterator iterator, FixedBitSet bits) throws java.io.IOException
iterator - the doc ID set iterator for applybits - the bit set to apply the deletes tojava.io.IOExceptionvoid onDocValuesUpdate(FieldInfo info, DocValuesFieldUpdates.Iterator iterator) throws java.io.IOException
PendingDeletesonDocValuesUpdate in class PendingDeletesinfo - the field info of the field that's updatediterator - the values to applyjava.io.IOExceptionprivate boolean assertPendingDeletes()
public java.lang.String toString()
toString in class PendingDeletesint numDeletesToMerge(MergePolicy policy, IOSupplier<CodecReader> readerIOSupplier) throws java.io.IOException
numDeletesToMerge in class PendingDeletesjava.io.IOExceptionprivate void ensureInitialized(IOSupplier<CodecReader> readerIOSupplier) throws java.io.IOException
java.io.IOExceptionboolean isFullyDeleted(IOSupplier<CodecReader> readerIOSupplier) throws java.io.IOException
PendingDeletestrue iff the segment represented by this PendingDeletes is fully deletedisFullyDeleted in class PendingDeletesjava.io.IOExceptionprivate FieldInfos readFieldInfos() throws java.io.IOException
java.io.IOExceptionBits getHardLiveDocs()
PendingDeletesgetHardLiveDocs in class PendingDeletesboolean mustInitOnDelete()
PendingDeletestrue if we have to initialize this PendingDeletes before PendingDeletes.delete(int);
otherwise this PendingDeletes is ready to accept deletes. A PendingDeletes can be initialized
by providing it a reader via PendingDeletes.onNewReader(CodecReader, SegmentCommitInfo).mustInitOnDelete in class PendingDeletesstatic int countSoftDeletes(DocIdSetIterator softDeletedDocs, Bits hardDeletes) throws java.io.IOException
java.io.IOException