Search in sources :

Example 1 with OnlyForTest

use of org.apache.ignite.raft.jraft.util.OnlyForTest in project ignite-3 by apache.

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.groupId = groupId;
        task.type = TaskType.FLUSH;
        task.shutdownLatch = latch;
    });
    latch.await();
}
Also used : CountDownLatch(java.util.concurrent.CountDownLatch) OnlyForTest(org.apache.ignite.raft.jraft.util.OnlyForTest)

Example 2 with OnlyForTest

use of org.apache.ignite.raft.jraft.util.OnlyForTest in project ignite-3 by apache.

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.groupId = this.groupId;
        task.shutdownLatch = latch;
    });
    latch.await();
}
Also used : CountDownLatch(java.util.concurrent.CountDownLatch) OnlyForTest(org.apache.ignite.raft.jraft.util.OnlyForTest)

Aggregations

CountDownLatch (java.util.concurrent.CountDownLatch)2 OnlyForTest (org.apache.ignite.raft.jraft.util.OnlyForTest)2