Search in sources :

Example 1 with Describer

use of org.apache.ignite.raft.jraft.util.Describer in project ignite-3 by apache.

the class NodeImpl method describe.

@Override
public void describe(final Printer out) {
    // node
    final String _nodeId;
    final String _state;
    final String _leaderId;
    final long _currTerm;
    final String _conf;
    final int _targetPriority;
    this.readLock.lock();
    try {
        _nodeId = String.valueOf(getNodeId());
        _state = String.valueOf(this.state);
        _leaderId = String.valueOf(this.leaderId);
        _currTerm = this.currTerm;
        _conf = String.valueOf(this.conf);
        _targetPriority = this.targetPriority;
    } finally {
        this.readLock.unlock();
    }
    // 
    out.print("nodeId: ").println(_nodeId);
    // 
    out.print("state: ").println(_state);
    // 
    out.print("leaderId: ").println(_leaderId);
    // 
    out.print("term: ").println(_currTerm);
    // 
    out.print("conf: ").println(_conf);
    // 
    out.print("targetPriority: ").println(_targetPriority);
    // timers
    out.println("electionTimer: ");
    this.electionTimer.describe(out);
    out.println("voteTimer: ");
    this.voteTimer.describe(out);
    out.println("stepDownTimer: ");
    this.stepDownTimer.describe(out);
    out.println("snapshotTimer: ");
    this.snapshotTimer.describe(out);
    // logManager
    out.println("logManager: ");
    this.logManager.describe(out);
    // fsmCaller
    out.println("fsmCaller: ");
    this.fsmCaller.describe(out);
    // ballotBox
    out.println("ballotBox: ");
    this.ballotBox.describe(out);
    // snapshotExecutor
    out.println("snapshotExecutor: ");
    if (this.snapshotExecutor != null) {
        this.snapshotExecutor.describe(out);
    }
    // replicators
    out.println("replicatorGroup: ");
    this.replicatorGroup.describe(out);
    // log storage
    if (this.logStorage instanceof Describer) {
        out.println("logStorage: ");
        ((Describer) this.logStorage).describe(out);
    }
}
Also used : ByteString(org.apache.ignite.raft.jraft.util.ByteString) Describer(org.apache.ignite.raft.jraft.util.Describer)

Aggregations

ByteString (org.apache.ignite.raft.jraft.util.ByteString)1 Describer (org.apache.ignite.raft.jraft.util.Describer)1