protected FixedBitSet getMutableBits() { // if we pull mutable bits but we haven't been initialized something is completely off. // this means we receive deletes without having the bitset that is on-disk ready to be cloned assert liveDocsInitialized : "can't delete if liveDocs are not initialized"; if (writeableLiveDocs == null) { // Copy on write: this means we've cloned a // SegmentReader sharing the current liveDocs // instance; must now make a private clone so we can // change it: if (liveDocs != null) { writeableLiveDocs = FixedBitSet.copyOf(liveDocs); } else { writeableLiveDocs = new FixedBitSet(info.info.maxDoc()); writeableLiveDocs.set(0, info.info.maxDoc()); } liveDocs = writeableLiveDocs.asReadOnlyBits(); } return writeableLiveDocs; }
static LeafReader wrap(LeafReader reader, String field) throws IOException { DocIdSetIterator iterator = DocValuesFieldExistsQuery.getDocValuesDocIdSetIterator(field, reader); if (iterator == null) { return reader; } Bits liveDocs = reader.getLiveDocs(); final FixedBitSet bits; if (liveDocs != null) { bits = FixedBitSet.copyOf(liveDocs); } else { bits = new FixedBitSet(reader.maxDoc()); bits.set(0, reader.maxDoc()); } int numSoftDeletes = PendingSoftDeletes.applySoftDeletes(iterator, bits); int numDeletes = reader.numDeletedDocs() + numSoftDeletes; int numDocs = reader.maxDoc() - numDeletes; assert assertDocCounts(numDocs, numSoftDeletes, reader); return reader instanceof CodecReader ? new SoftDeletesFilterCodecReader((CodecReader) reader, bits, numDocs) : new SoftDeletesFilterLeafReader(reader, bits, numDocs); }
Scorer scorer = getScorer(builder.build(), wrappedReader); if (scorer != null) { FixedBitSet cloneLiveDocs = FixedBitSet.copyOf(liveDocs); DocIdSetIterator iterator = scorer.iterator(); int numExtraLiveDocs = 0;
protected FixedBitSet getMutableBits() { // if we pull mutable bits but we haven't been initialized something is completely off. // this means we receive deletes without having the bitset that is on-disk ready to be cloned assert liveDocsInitialized : "can't delete if liveDocs are not initialized"; if (writeableLiveDocs == null) { // Copy on write: this means we've cloned a // SegmentReader sharing the current liveDocs // instance; must now make a private clone so we can // change it: if (liveDocs != null) { writeableLiveDocs = FixedBitSet.copyOf(liveDocs); } else { writeableLiveDocs = new FixedBitSet(info.info.maxDoc()); writeableLiveDocs.set(0, info.info.maxDoc()); } liveDocs = writeableLiveDocs.asReadOnlyBits(); } return writeableLiveDocs; }
static LeafReader wrap(LeafReader reader, String field) throws IOException { DocIdSetIterator iterator = DocValuesFieldExistsQuery.getDocValuesDocIdSetIterator(field, reader); if (iterator == null) { return reader; } Bits liveDocs = reader.getLiveDocs(); final FixedBitSet bits; if (liveDocs != null) { bits = FixedBitSet.copyOf(liveDocs); } else { bits = new FixedBitSet(reader.maxDoc()); bits.set(0, reader.maxDoc()); } int numSoftDeletes = PendingSoftDeletes.applySoftDeletes(iterator, bits); int numDeletes = reader.numDeletedDocs() + numSoftDeletes; int numDocs = reader.maxDoc() - numDeletes; assert assertDocCounts(numDocs, numSoftDeletes, reader); return reader instanceof CodecReader ? new SoftDeletesFilterCodecReader((CodecReader) reader, bits, numDocs) : new SoftDeletesFilterLeafReader(reader, bits, numDocs); }
Scorer scorer = getScorer(builder.build(), wrappedReader); if (scorer != null) { FixedBitSet cloneLiveDocs = FixedBitSet.copyOf(liveDocs); DocIdSetIterator iterator = scorer.iterator(); int numExtraLiveDocs = 0;