Ejemplo n.º 1
0
 internal void AbortPendingFlushes(ISet <string> newFiles)
 {
     UninterruptableMonitor.Enter(this);
     try
     {
         try
         {
             foreach (DocumentsWriterPerThread dwpt in flushQueue)
             {
                 try
                 {
                     documentsWriter.SubtractFlushedNumDocs(dwpt.NumDocsInRAM);
                     dwpt.Abort(newFiles);
                 }
                 catch (Exception ex) when(ex.IsThrowable())
                 {
                     // ignore - keep on aborting the flush queue
                 }
                 finally
                 {
                     DoAfterFlush(dwpt);
                 }
             }
             foreach (BlockedFlush blockedFlush in blockedFlushes)
             {
                 try
                 {
                     flushingWriters[blockedFlush.Dwpt] = blockedFlush.Bytes;
                     documentsWriter.SubtractFlushedNumDocs(blockedFlush.Dwpt.NumDocsInRAM);
                     blockedFlush.Dwpt.Abort(newFiles);
                 }
                 catch (Exception ex) when(ex.IsThrowable())
                 {
                     // ignore - keep on aborting the blocked queue
                 }
                 finally
                 {
                     DoAfterFlush(blockedFlush.Dwpt);
                 }
             }
         }
         finally
         {
             flushQueue.Clear();
             blockedFlushes.Clear();
             UpdateStallState();
         }
     }
     finally
     {
         UninterruptableMonitor.Exit(this);
     }
 }
Ejemplo n.º 2
0
 internal void AbortPendingFlushes(ISet <string> newFiles)
 {
     lock (this)
     {
         try
         {
             foreach (DocumentsWriterPerThread dwpt in flushQueue)
             {
                 try
                 {
                     documentsWriter.SubtractFlushedNumDocs(dwpt.NumDocsInRAM);
                     dwpt.Abort(newFiles);
                 }
                 catch (Exception)
                 {
                     // ignore - keep on aborting the flush queue
                 }
                 finally
                 {
                     DoAfterFlush(dwpt);
                 }
             }
             foreach (BlockedFlush blockedFlush in blockedFlushes)
             {
                 try
                 {
                     flushingWriters[blockedFlush.Dwpt] = Convert.ToInt64(blockedFlush.Bytes);
                     documentsWriter.SubtractFlushedNumDocs(blockedFlush.Dwpt.NumDocsInRAM);
                     blockedFlush.Dwpt.Abort(newFiles);
                 }
                 catch (Exception)
                 {
                     // ignore - keep on aborting the blocked queue
                 }
                 finally
                 {
                     DoAfterFlush(blockedFlush.Dwpt);
                 }
             }
         }
         finally
         {
             flushQueue.Clear();
             blockedFlushes.Clear();
             UpdateStallState();
         }
     }
 }