java.lang.Object
org.apache.lucene.index.PendingDeletes
org.apache.lucene.index.PendingSoftDeletes
-
Field Summary
FieldsFields inherited from class org.apache.lucene.index.PendingDeletes
info, liveDocsInitialized, pendingDeleteCount -
Constructor Summary
ConstructorsConstructorDescriptionPendingSoftDeletes(String field, SegmentCommitInfo info) PendingSoftDeletes(String field, SegmentReader reader, SegmentCommitInfo info) -
Method Summary
Modifier and TypeMethodDescription(package private) static intapplySoftDeletes(DocIdSetIterator iterator, FixedBitSet bits) Clears all bits in the given bitset that are set and are also in the given DocIdSetIterator.private boolean(package private) static intcountSoftDeletes(DocIdSetIterator softDeletedDocs, Bits hardDeletes) (package private) booleandelete(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) voidResets the pending docsprivate voidensureInitialized(IOSupplier<CodecReader> readerIOSupplier) (package private) BitsReturns a snapshot of the hard live docs.(package private) booleanisFullyDeleted(IOSupplier<CodecReader> readerIOSupplier) Returnstrueiff the segment represented by thisPendingDeletesis fully deleted(package private) booleanReturnstrueif we have to initialize this PendingDeletes beforePendingDeletes.delete(int); otherwise this PendingDeletes is ready to accept deletes.(package private) intnumDeletesToMerge(MergePolicy policy, IOSupplier<CodecReader> readerIOSupplier) protected intReturns the number of pending deletes that are not written to disk.(package private) voidonDocValuesUpdate(FieldInfo info, DocValuesFieldUpdates.Iterator iterator) Called for every field update for the given field at flush time(package private) voidonNewReader(CodecReader reader, SegmentCommitInfo info) Called once a new reader is opened for this segment ie.private FieldInfostoString()(package private) booleanwriteLiveDocs(Directory dir) Writes the live docs to disk and returnstrueif any new docs were written.Methods inherited from class org.apache.lucene.index.PendingDeletes
getDelCount, getLiveDocs, getMutableBits, needsRefresh, numDocs, verifyDocCounts
-
Field Details
-
field
-
dvGeneration
private long dvGeneration -
hardDeletes
-
-
Constructor Details
-
PendingSoftDeletes
PendingSoftDeletes(String field, SegmentCommitInfo info) -
PendingSoftDeletes
PendingSoftDeletes(String field, SegmentReader reader, SegmentCommitInfo info)
-
-
Method Details
-
delete
Description copied from class:PendingDeletesMarks a document as deleted in this segment and return true if a document got actually deleted or if the document was already deleted.- Overrides:
deletein classPendingDeletes- Throws:
IOException
-
numPendingDeletes
protected int numPendingDeletes()Description copied from class:PendingDeletesReturns the number of pending deletes that are not written to disk.- Overrides:
numPendingDeletesin classPendingDeletes
-
onNewReader
Description copied from class:PendingDeletesCalled once a new reader is opened for this segment ie. when deletes or updates are applied.- Overrides:
onNewReaderin classPendingDeletes- Throws:
IOException
-
writeLiveDocs
Description copied from class:PendingDeletesWrites the live docs to disk and returnstrueif any new docs were written.- Overrides:
writeLiveDocsin classPendingDeletes- Throws:
IOException
-
dropChanges
void dropChanges()Description copied from class:PendingDeletesResets the pending docs- Overrides:
dropChangesin classPendingDeletes
-
applySoftDeletes
Clears all bits in the given bitset that are set and are also in the given DocIdSetIterator.- Parameters:
iterator- the doc ID set iterator for applybits- the bit set to apply the deletes to- Returns:
- the number of bits changed by this function
- Throws:
IOException
-
onDocValuesUpdate
Description copied from class:PendingDeletesCalled for every field update for the given field at flush time- Overrides:
onDocValuesUpdatein classPendingDeletes- Parameters:
info- the field info of the field that's updatediterator- the values to apply- Throws:
IOException
-
assertPendingDeletes
private boolean assertPendingDeletes() -
toString
- Overrides:
toStringin classPendingDeletes
-
numDeletesToMerge
int numDeletesToMerge(MergePolicy policy, IOSupplier<CodecReader> readerIOSupplier) throws IOException - Overrides:
numDeletesToMergein classPendingDeletes- Throws:
IOException
-
ensureInitialized
- Throws:
IOException
-
isFullyDeleted
Description copied from class:PendingDeletesReturnstrueiff the segment represented by thisPendingDeletesis fully deleted- Overrides:
isFullyDeletedin classPendingDeletes- Throws:
IOException
-
readFieldInfos
- Throws:
IOException
-
getHardLiveDocs
Bits getHardLiveDocs()Description copied from class:PendingDeletesReturns a snapshot of the hard live docs.- Overrides:
getHardLiveDocsin classPendingDeletes
-
mustInitOnDelete
boolean mustInitOnDelete()Description copied from class:PendingDeletesReturnstrueif we have to initialize this PendingDeletes beforePendingDeletes.delete(int); otherwise this PendingDeletes is ready to accept deletes. A PendingDeletes can be initialized by providing it a reader viaPendingDeletes.onNewReader(CodecReader, SegmentCommitInfo).- Overrides:
mustInitOnDeletein classPendingDeletes
-
countSoftDeletes
- Throws:
IOException
-