Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(timeout = 10_000) public void checkpointOnStopShouldFlushAsFastAsPossible() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void CheckpointOnStopShouldFlushAsFastAsPossible()
        {
            CheckableIOLimiter ioLimiter = new CheckableIOLimiter();

            System.Threading.CountdownEvent checkPointerLatch = new System.Threading.CountdownEvent(1);
            WaitUnlimitedCheckPointer       checkPointer      = new WaitUnlimitedCheckPointer(ioLimiter, checkPointerLatch);
            CheckPointScheduler             scheduler         = new CheckPointScheduler(checkPointer, ioLimiter, _jobScheduler, 0L, _health);

            scheduler.Start();

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.concurrent.Future<?> checkpointerStarter = executor.submit(jobScheduler::runJob);
            Future <object> checkpointerStarter = _executor.submit(_jobScheduler.runJob);

            checkPointerLatch.await();
            scheduler.Stop();
            checkpointerStarter.get();

            assertTrue("Checkpointer should be created.", checkPointer.CheckpointCreated);
            assertTrue("Limiter should be enabled in the end.", ioLimiter.Limited);
        }
Пример #2
0
 internal WaitUnlimitedCheckPointer(CheckableIOLimiter ioLimiter, System.Threading.CountdownEvent latch)
 {
     this.IoLimiter            = ioLimiter;
     this.Latch                = latch;
     CheckpointCreatedConflict = false;
 }