Example #1
0
 public override void OnDelete(DocumentsWriterFlushControl control, ThreadState state)
 {
     if (FlushOnDeleteTerms)
     {
         // Flush this state by num del terms
         int maxBufferedDeleteTerms = m_indexWriterConfig.MaxBufferedDeleteTerms;
         if (control.NumGlobalTermDeletes >= maxBufferedDeleteTerms)
         {
             control.SetApplyAllDeletes();
         }
     }
     if ((FlushOnRAM && control.DeleteBytesUsed > (1024 * 1024 * m_indexWriterConfig.RAMBufferSizeMB)))
     {
         control.SetApplyAllDeletes();
         if (m_infoStream.IsEnabled("FP"))
         {
             m_infoStream.Message("FP", "force apply deletes bytesUsed=" + control.DeleteBytesUsed + " vs ramBuffer=" + (1024 * 1024 * m_indexWriterConfig.RAMBufferSizeMB));
         }
     }
 }