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());
}
}
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);
}
}
Aggregations