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, verifyDocCounts
private 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
PendingDeletes
delete
in class PendingDeletes
java.io.IOException
protected int numPendingDeletes()
PendingDeletes
numPendingDeletes
in class PendingDeletes
void onNewReader(CodecReader reader, SegmentCommitInfo info) throws java.io.IOException
PendingDeletes
onNewReader
in class PendingDeletes
java.io.IOException
boolean writeLiveDocs(Directory dir) throws java.io.IOException
PendingDeletes
true
if any new docs were written.writeLiveDocs
in class PendingDeletes
java.io.IOException
void dropChanges()
PendingDeletes
dropChanges
in class PendingDeletes
static 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.IOException
void onDocValuesUpdate(FieldInfo info, DocValuesFieldUpdates.Iterator iterator) throws java.io.IOException
PendingDeletes
onDocValuesUpdate
in class PendingDeletes
info
- the field info of the field that's updatediterator
- the values to applyjava.io.IOException
private boolean assertPendingDeletes()
public java.lang.String toString()
toString
in class PendingDeletes
int numDeletesToMerge(MergePolicy policy, IOSupplier<CodecReader> readerIOSupplier) throws java.io.IOException
numDeletesToMerge
in class PendingDeletes
java.io.IOException
private void ensureInitialized(IOSupplier<CodecReader> readerIOSupplier) throws java.io.IOException
java.io.IOException
boolean isFullyDeleted(IOSupplier<CodecReader> readerIOSupplier) throws java.io.IOException
PendingDeletes
true
iff the segment represented by this PendingDeletes
is fully deletedisFullyDeleted
in class PendingDeletes
java.io.IOException
private FieldInfos readFieldInfos() throws java.io.IOException
java.io.IOException
Bits getHardLiveDocs()
PendingDeletes
getHardLiveDocs
in class PendingDeletes
boolean mustInitOnDelete()
PendingDeletes
true
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 PendingDeletes
static int countSoftDeletes(DocIdSetIterator softDeletedDocs, Bits hardDeletes) throws java.io.IOException
java.io.IOException