Search in sources :

Example 6 with RaftException

use of org.apache.ignite.raft.jraft.error.RaftException in project ignite-3 by apache.

the class LogManagerImpl method reportError.

private void reportError(final int code, final String fmt, final Object... args) {
    this.hasError = true;
    final RaftException error = new RaftException(ErrorType.ERROR_TYPE_LOG);
    error.setStatus(new Status(code, fmt, args));
    this.fsmCaller.onError(error);
}
Also used : Status(org.apache.ignite.raft.jraft.Status) RaftException(org.apache.ignite.raft.jraft.error.RaftException)

Example 7 with RaftException

use of org.apache.ignite.raft.jraft.error.RaftException in project ignite-3 by apache.

the class FSMCallerTest method testOnError.

@Test
public void testOnError() throws Exception {
    this.fsmCaller.onError(new RaftException(ErrorType.ERROR_TYPE_LOG, new Status(-1, "test")));
    this.fsmCaller.flush();
    assertFalse(this.fsmCaller.getError().getStatus().isOk());
    assertEquals(ErrorType.ERROR_TYPE_LOG, this.fsmCaller.getError().getType());
    Mockito.verify(this.node).onError(Mockito.any());
    Mockito.verify(this.fsm).onError(Mockito.any());
}
Also used : Status(org.apache.ignite.raft.jraft.Status) RaftException(org.apache.ignite.raft.jraft.error.RaftException) Test(org.junit.jupiter.api.Test)

Aggregations

RaftException (org.apache.ignite.raft.jraft.error.RaftException)7 Status (org.apache.ignite.raft.jraft.Status)6 PeerId (org.apache.ignite.raft.jraft.entity.PeerId)2 RaftOutter (org.apache.ignite.raft.jraft.entity.RaftOutter)2 Test (org.junit.jupiter.api.Test)2 Node (org.apache.ignite.raft.jraft.Node)1 Configuration (org.apache.ignite.raft.jraft.conf.Configuration)1 LogId (org.apache.ignite.raft.jraft.entity.LogId)1 Message (org.apache.ignite.raft.jraft.rpc.Message)1 InstallSnapshotRequest (org.apache.ignite.raft.jraft.rpc.RpcRequests.InstallSnapshotRequest)1 InstallSnapshotResponse (org.apache.ignite.raft.jraft.rpc.RpcRequests.InstallSnapshotResponse)1 SnapshotReader (org.apache.ignite.raft.jraft.storage.snapshot.SnapshotReader)1 ByteString (org.apache.ignite.raft.jraft.util.ByteString)1 DisruptorMetricSet (org.apache.ignite.raft.jraft.util.DisruptorMetricSet)1 Endpoint (org.apache.ignite.raft.jraft.util.Endpoint)1