/** * Publishes the flushed segment, segment private deletes (if any) and its * associated global delete (if present) to IndexWriter. The actual * publishing operation is synced on IW -> BDS so that the {@link SegmentInfo}'s * delete generation is always GlobalPacket_deleteGeneration + 1 */ protected final void publishFlushedSegment(IndexWriter indexWriter, FlushedSegment newSegment, FrozenBufferedUpdates globalPacket) throws IOException { assert newSegment != null; assert newSegment.segmentInfo != null; final FrozenBufferedUpdates segmentUpdates = newSegment.segmentUpdates; //System.out.println("FLUSH: " + newSegment.segmentInfo.info.name); if (indexWriter.infoStream.isEnabled("DW")) { indexWriter.infoStream.message("DW", "publishFlushedSegment seg-private updates=" + segmentUpdates); } if (segmentUpdates != null && indexWriter.infoStream.isEnabled("DW")) { indexWriter.infoStream.message("DW", "flush: push buffered seg private updates: " + segmentUpdates); } // now publish! indexWriter.publishFlushedSegment(newSegment.segmentInfo, segmentUpdates, globalPacket); }
/** * Publishes the flushed segment, segment private deletes (if any) and its * associated global delete (if present) to IndexWriter. The actual * publishing operation is synced on IW -> BDS so that the {@link SegmentInfo}'s * delete generation is always GlobalPacket_deleteGeneration + 1 */ private void publishFlushedSegment(FlushedSegment newSegment, FrozenBufferedDeletes globalPacket) throws IOException { assert newSegment != null; assert newSegment.segmentInfo != null; final FrozenBufferedDeletes segmentDeletes = newSegment.segmentDeletes; //System.out.println("FLUSH: " + newSegment.segmentInfo.info.name); if (infoStream.isEnabled("DW")) { infoStream.message("DW", "publishFlushedSegment seg-private deletes=" + segmentDeletes); } if (segmentDeletes != null && infoStream.isEnabled("DW")) { infoStream.message("DW", "flush: push buffered seg private deletes: " + segmentDeletes); } // now publish! indexWriter.publishFlushedSegment(newSegment.segmentInfo, segmentDeletes, globalPacket); }
protected final void finishFlush(IndexWriter indexWriter, FlushedSegment newSegment, FrozenBufferedUpdates bufferedUpdates) throws IOException { // Finish the flushed segment and publish it to IndexWriter if (newSegment == null) { assert bufferedUpdates != null; if (bufferedUpdates != null && bufferedUpdates.any()) { indexWriter.publishFrozenUpdates(bufferedUpdates); if (indexWriter.infoStream.isEnabled("DW")) { indexWriter.infoStream.message("DW", "flush: push buffered updates: " + bufferedUpdates); } } } else { publishFlushedSegment(indexWriter, newSegment, bufferedUpdates); } }
void finishFlush(FlushedSegment newSegment, FrozenBufferedDeletes bufferedDeletes) throws IOException { // Finish the flushed segment and publish it to IndexWriter if (newSegment == null) { assert bufferedDeletes != null; if (bufferedDeletes != null && bufferedDeletes.any()) { indexWriter.publishFrozenDeletes(bufferedDeletes); if (infoStream.isEnabled("DW")) { infoStream.message("DW", "flush: push buffered deletes: " + bufferedDeletes); } } } else { publishFlushedSegment(newSegment, bufferedDeletes); } }
synchronized void addSegment(SegmentFlushTicket ticket, FlushedSegment segment) { // the actual flush is done asynchronously and once done the FlushedSegment // is passed to the flush ticket ticket.setSegment(segment); }
protected void setSegment(FlushedSegment segment) { assert !failed; this.segment = segment; }