//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void writeOneIteration(TestCoordinator testCoordinator, java.util.concurrent.atomic.AtomicBoolean failHalt) throws java.io.IOException, InterruptedException private void WriteOneIteration(TestCoordinator testCoordinator, AtomicBoolean failHalt) { int batchSize = testCoordinator.WriteBatchSize(); IEnumerable <UpdateOperation> toWrite = testCoordinator.NextToWrite(); IEnumerator <UpdateOperation> toWriteIterator = toWrite.GetEnumerator(); while (toWriteIterator.MoveNext()) { using (Writer <KEY, VALUE> writer = _index.writer()) { int inBatch = 0; while (toWriteIterator.MoveNext() && inBatch < batchSize) { UpdateOperation operation = toWriteIterator.Current; operation.Apply(writer); if (failHalt.get()) { break; } inBatch++; } } // Sleep to allow checkpointer to step in MILLISECONDS.sleep(1); } }
private ThreadStart CheckpointThread(AtomicBoolean endSignal, AtomicReference <Exception> readerError, AtomicBoolean failHalt) { return(() => { while (!endSignal.get()) { try { _index.checkpoint(IOLimiter.UNLIMITED); // Sleep a little in between checkpoints MILLISECONDS.sleep(20L); } catch (Exception e) { readerError.set(e); failHalt.set(true); } } }); }