Search in sources :

Example 1 with ClientId

use of org.apache.ratis.protocol.ClientId in project incubator-ratis by apache.

the class RetryCacheTestUtil method assertFailure.

public static void assertFailure(RetryCache cache, RaftProtos.LogEntryProto logEntry, boolean isFailed) {
    if (logEntry.getLogEntryBodyCase() == RaftProtos.LogEntryProto.LogEntryBodyCase.SMLOGENTRY) {
        ClientId clientId = ClientId.valueOf(logEntry.getClientId());
        long callId = logEntry.getCallId();
        Assert.assertEquals(isFailed, cache.get(clientId, callId).isFailed());
    }
}
Also used : ClientId(org.apache.ratis.protocol.ClientId)

Example 2 with ClientId

use of org.apache.ratis.protocol.ClientId in project incubator-ratis by apache.

the class RetryCacheTestUtil method createEntry.

public static void createEntry(RetryCache cache, RaftProtos.LogEntryProto logEntry) {
    if (logEntry.getLogEntryBodyCase() == RaftProtos.LogEntryProto.LogEntryBodyCase.SMLOGENTRY) {
        ClientId clientId = ClientId.valueOf(logEntry.getClientId());
        long callId = logEntry.getCallId();
        cache.getOrCreateEntry(clientId, callId);
    }
}
Also used : ClientId(org.apache.ratis.protocol.ClientId)

Aggregations

ClientId (org.apache.ratis.protocol.ClientId)2