Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void merge(IndexWriter writer, MergeTrigger trigger, boolean newMergesFound) throws java.io.IOException
        public override void Merge(IndexWriter writer, MergeTrigger trigger, bool newMergesFound)
        {
            while (true)
            {
                MergePolicy.OneMerge merge = writer.NextMerge;
                if (merge == null)
                {
                    return;
                }
                bool success = false;
                try
                {
                    MergeThread mergeThread = getMergeThread(writer, merge);
                    _writerTaskCounter.increment();
                    PooledConcurrentMergePool.MergeThreadsPool.submit(MergeTask(mergeThread));
                    success = true;
                }
                finally
                {
                    if (!success)
                    {
                        writer.mergeFinish(merge);
                        _writerTaskCounter.decrement();
                    }
                }
            }
        }
Example #2
0
 public override void Run()
 {
     try
     {
         MergeThread.run();
     }
     finally
     {
         TaskCounter.decrement();
     }
 }
 public override void TransactionFinished(bool committed, bool write)
 {
     if (write)
     {
         _activeWriteTransactionCount.decrement();
     }
     else
     {
         _activeReadTransactionCount.decrementAndGet();
     }
     if (committed)
     {
         IncrementCounter(_committedReadTransactionCount, _committedWriteTransactionCount, write);
     }
     else
     {
         IncrementCounter(_rolledBackReadTransactionCount, _rolledBackWriteTransactionCount, write);
     }
 }