Search in sources :

Example 1 with MemoryRaftLog

use of org.apache.ratis.server.storage.MemoryRaftLog in project incubator-ratis by apache.

the class MiniRaftCluster method printAllLogs.

public String printAllLogs() {
    StringBuilder b = new StringBuilder("\n#servers = " + servers.size() + "\n");
    for (RaftServerImpl s : iterateServerImpls()) {
        b.append("  ");
        b.append(s).append("\n");
        final RaftLog log = s.getState().getLog();
        if (log instanceof MemoryRaftLog) {
            b.append("    ");
            b.append(((MemoryRaftLog) log).getEntryString());
        }
    }
    return b.toString();
}
Also used : RaftServerImpl(org.apache.ratis.server.impl.RaftServerImpl) MemoryRaftLog(org.apache.ratis.server.storage.MemoryRaftLog) MemoryRaftLog(org.apache.ratis.server.storage.MemoryRaftLog) RaftLog(org.apache.ratis.server.storage.RaftLog)

Aggregations

RaftServerImpl (org.apache.ratis.server.impl.RaftServerImpl)1 MemoryRaftLog (org.apache.ratis.server.storage.MemoryRaftLog)1 RaftLog (org.apache.ratis.server.storage.RaftLog)1