Package org.apache.lucene.index
Class PendingSoftDeletes
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 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
(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
Resets the pending docsprivate void
ensureInitialized
(IOSupplier<CodecReader> readerIOSupplier) (package private) Bits
Returns a snapshot of the hard live docs.(package private) boolean
isFullyDeleted
(IOSupplier<CodecReader> readerIOSupplier) Returnstrue
iff the segment represented by thisPendingDeletes
is fully deleted(package private) boolean
Returnstrue
if we have to initialize this PendingDeletes beforePendingDeletes.delete(int)
; otherwise this PendingDeletes is ready to accept deletes.(package private) int
numDeletesToMerge
(MergePolicy policy, IOSupplier<CodecReader> readerIOSupplier) protected int
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
toString()
(package private) boolean
writeLiveDocs
(Directory dir) Writes the live docs to disk and returnstrue
if 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:PendingDeletes
Marks a document as deleted in this segment and return true if a document got actually deleted or if the document was already deleted.- Overrides:
delete
in classPendingDeletes
- Throws:
IOException
-
numPendingDeletes
protected int numPendingDeletes()Description copied from class:PendingDeletes
Returns the number of pending deletes that are not written to disk.- Overrides:
numPendingDeletes
in classPendingDeletes
-
onNewReader
Description copied from class:PendingDeletes
Called once a new reader is opened for this segment ie. when deletes or updates are applied.- Overrides:
onNewReader
in classPendingDeletes
- Throws:
IOException
-
writeLiveDocs
Description copied from class:PendingDeletes
Writes the live docs to disk and returnstrue
if any new docs were written.- Overrides:
writeLiveDocs
in classPendingDeletes
- Throws:
IOException
-
dropChanges
void dropChanges()Description copied from class:PendingDeletes
Resets the pending docs- Overrides:
dropChanges
in 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:PendingDeletes
Called for every field update for the given field at flush time- Overrides:
onDocValuesUpdate
in classPendingDeletes
- Parameters:
info
- the field info of the field that's updatediterator
- the values to apply- Throws:
IOException
-
assertPendingDeletes
private boolean assertPendingDeletes() -
toString
- Overrides:
toString
in classPendingDeletes
-
numDeletesToMerge
int numDeletesToMerge(MergePolicy policy, IOSupplier<CodecReader> readerIOSupplier) throws IOException - Overrides:
numDeletesToMerge
in classPendingDeletes
- Throws:
IOException
-
ensureInitialized
- Throws:
IOException
-
isFullyDeleted
Description copied from class:PendingDeletes
Returnstrue
iff the segment represented by thisPendingDeletes
is fully deleted- Overrides:
isFullyDeleted
in classPendingDeletes
- Throws:
IOException
-
readFieldInfos
- Throws:
IOException
-
getHardLiveDocs
Bits getHardLiveDocs()Description copied from class:PendingDeletes
Returns a snapshot of the hard live docs.- Overrides:
getHardLiveDocs
in classPendingDeletes
-
mustInitOnDelete
boolean mustInitOnDelete()Description copied from class:PendingDeletes
Returnstrue
if 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:
mustInitOnDelete
in classPendingDeletes
-
countSoftDeletes
- Throws:
IOException
-