code: func (t *FlushTicketImpl) publishFlushedSegment(indexWriter *IndexWriter,
  	newSegment *FlushedSegment, globalPacket *FrozenBufferedUpdates) error {
  	assert(newSegment != nil)
  	assert(newSegment.segmentInfo != nil)
  	segmentUpdates := newSegment.segmentUpdates
  	// fmt.Printf("FLUSH: %v\n", newSegment.segmentInfo.Name())
  	if is := indexWriter.infoStream; is.IsEnabled("DW") {
  		is.Message("DW", "publishFlushedSegment seg-private updates=%v", segmentUpdates)
  		if segmentUpdates != nil {
  			is.Message("DW", "flush: push buffered seg private updates: %v", segmentUpdates)
  		}
  	}
  	// now publish!
  	return indexWriter.publishFlushedSegment(newSegment.segmentInfo, segmentUpdates, globalPacket)
  }
docs: /*
  Publishes the flushed segment, segment private deletes (if any) and
  its associated global delete (if present) to IndexWriter. The actual
  publishing operation is syned on IW -> BDS so that the SegmentInfo's
  delete generation is always GlobalPacket_deleteGeneration + 1
  */