Java Code Examples for org.apache.ratis.protocol.RaftPeerId#toString()

The following examples show how to use org.apache.ratis.protocol.RaftPeerId#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OMNotLeaderException.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
public OMNotLeaderException(RaftPeerId currentPeerId,
    RaftPeerId suggestedLeaderPeerId) {
  super("OM:" + currentPeerId + " is not the leader. Suggested leader is" +
      " OM:" + suggestedLeaderPeerId + ".");
  this.currentPeerId = currentPeerId.toString();
  this.leaderPeerId = suggestedLeaderPeerId.toString();
}
 
Example 2
Source File: OMNotLeaderException.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
public OMNotLeaderException(RaftPeerId currentPeerId) {
  super("OM:" + currentPeerId + " is not the leader. Could not " +
      "determine the leader node.");
  this.currentPeerId = currentPeerId.toString();
  this.leaderPeerId = null;
}
 
Example 3
Source File: OrderedAsync.java    From incubator-ratis with Apache License 2.0 4 votes vote down vote up
private SlidingWindow.Client<PendingOrderedRequest, RaftClientReply> getSlidingWindow(RaftPeerId target) {
  final String id = target != null ? target.toString() : "RAFT";
  return slidingWindows.computeIfAbsent(id, key -> new SlidingWindow.Client<>(client.getId() + "->" + key));
}
 
Example 4
Source File: MiniRaftCluster.java    From incubator-ratis with Apache License 2.0 4 votes vote down vote up
public File getStorageDir(RaftPeerId id) {
  return new File(rootTestDir.get(), id.toString());
}
 
Example 5
Source File: MiniRaftCluster.java    From ratis with Apache License 2.0 4 votes vote down vote up
private File getStorageDir(RaftPeerId id) {
  return new File(rootTestDir.get(), id.toString());
}