Search in sources :

Example 6 with SnapshotMeta

use of org.apache.ignite.raft.jraft.entity.RaftOutter.SnapshotMeta in project ignite-3 by apache.

the class FSMCallerTest method testOnSnapshotSaveEmptyConf.

@Test
public void testOnSnapshotSaveEmptyConf() throws Exception {
    final CountDownLatch latch = new CountDownLatch(1);
    this.fsmCaller.onSnapshotSave(new SaveSnapshotClosure() {

        @Override
        public void run(final Status status) {
            assertFalse(status.isOk());
            assertEquals("Empty conf entry for lastAppliedIndex=10", status.getErrorMsg());
            latch.countDown();
        }

        @Override
        public SnapshotWriter start(final SnapshotMeta meta) {
            return null;
        }
    });
    latch.await();
}
Also used : Status(org.apache.ignite.raft.jraft.Status) SnapshotWriter(org.apache.ignite.raft.jraft.storage.snapshot.SnapshotWriter) SaveSnapshotClosure(org.apache.ignite.raft.jraft.closure.SaveSnapshotClosure) SnapshotMeta(org.apache.ignite.raft.jraft.entity.RaftOutter.SnapshotMeta) CountDownLatch(java.util.concurrent.CountDownLatch) Test(org.junit.jupiter.api.Test)

Aggregations

SnapshotMeta (org.apache.ignite.raft.jraft.entity.RaftOutter.SnapshotMeta)6 Status (org.apache.ignite.raft.jraft.Status)5 Test (org.junit.jupiter.api.Test)5 CountDownLatch (java.util.concurrent.CountDownLatch)4 LoadSnapshotClosure (org.apache.ignite.raft.jraft.closure.LoadSnapshotClosure)3 SnapshotReader (org.apache.ignite.raft.jraft.storage.snapshot.SnapshotReader)3 SaveSnapshotClosure (org.apache.ignite.raft.jraft.closure.SaveSnapshotClosure)2 SnapshotWriter (org.apache.ignite.raft.jraft.storage.snapshot.SnapshotWriter)2