use of com.alipay.sofa.jraft.util.OnlyForTest in project sofa-jraft by sofastack.
the class FSMCallerImpl method flush.
/**
* Flush all events in disruptor.
*/
@OnlyForTest
void flush() throws InterruptedException {
final CountDownLatch latch = new CountDownLatch(1);
enqueueTask((task, sequence) -> {
task.type = TaskType.FLUSH;
task.shutdownLatch = latch;
});
latch.await();
}
use of com.alipay.sofa.jraft.util.OnlyForTest in project sofa-jraft by sofastack.
the class ReadOnlyServiceImpl method flush.
/**
* Flush all events in disruptor.
*/
@OnlyForTest
void flush() throws InterruptedException {
final CountDownLatch latch = new CountDownLatch(1);
this.readIndexQueue.publishEvent((task, sequence) -> task.shutdownLatch = latch);
latch.await();
}
Aggregations