Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
public class QuorumInfo {
  private final String topic;

  private final Integer leaderId;
  private final List<ReplicaState> voters;
  private final List<ReplicaState> observers;

  public QuorumInfo(String topic, Integer leaderId, List<ReplicaState> voters, List<ReplicaState> observers) {
    this.topic = topic;
    this.leaderId = leaderId;
    this.voters = voters;
    this.observers = observers;
  }

  public String getTopic() {
    return topic;
  }

  public Integer getLeaderId() {
    return leaderId;
  }

  public List<ReplicaState> getVoters() {
    return voters;
  }

  public List<ReplicaState> getObservers() {
    return observers;
  }

  public static class ReplicaState {
    private final int replicaId;
    private final long logEndOffset;

    public ReplicaState(int replicaId, long logEndOffset) {
      this.replicaId = replicaId;
      this.logEndOffset = logEndOffset;
    }

    public int getReplicaId() {
      return replicaId;
    }

    public long getLogEndOffset() {
      return logEndOffset;
    }
  }
}

...