use of com.hazelcast.cp.internal.raft.impl.RaftNodeImpl in project hazelcast by hazelcast.
the class LocalRaftGroup method getLeaderEndpoint.
public RaftEndpoint getLeaderEndpoint() {
RaftEndpoint leader = null;
for (int i = 0; i < size(); i++) {
if (integrations[i].isShutdown()) {
continue;
}
RaftNodeImpl node = nodes[i];
RaftEndpoint endpoint = getLeaderMember(node);
if (leader == null) {
leader = endpoint;
} else if (!leader.equals(endpoint)) {
throw new AssertionError("Group doesn't have a single leader endpoint yet!");
}
}
return leader;
}
use of com.hazelcast.cp.internal.raft.impl.RaftNodeImpl in project hazelcast by hazelcast.
the class LocalRaftIntegration method send.
@Override
public boolean send(InstallSnapshot request, RaftEndpoint target) {
assertNotEquals(localEndpoint, target);
RaftNodeImpl node = nodes.get(target);
if (node == null) {
return false;
}
if (shouldDrop(request, target)) {
return true;
}
node.handleInstallSnapshot(alterMessageIfNeeded(request, target));
return true;
}
use of com.hazelcast.cp.internal.raft.impl.RaftNodeImpl in project hazelcast by hazelcast.
the class LocalRaftIntegration method send.
@Override
public boolean send(AppendFailureResponse response, RaftEndpoint target) {
assertNotEquals(localEndpoint, target);
RaftNodeImpl node = nodes.get(target);
if (node == null) {
return false;
}
if (shouldDrop(response, target)) {
return true;
}
node.handleAppendResponse(alterMessageIfNeeded(response, target));
return true;
}
use of com.hazelcast.cp.internal.raft.impl.RaftNodeImpl in project hazelcast by hazelcast.
the class LocalRaftIntegration method send.
@Override
public boolean send(PreVoteResponse response, RaftEndpoint target) {
assertNotEquals(localEndpoint, target);
RaftNodeImpl node = nodes.get(target);
if (node == null) {
return false;
}
if (shouldDrop(response, target)) {
return true;
}
node.handlePreVoteResponse(alterMessageIfNeeded(response, target));
return true;
}
use of com.hazelcast.cp.internal.raft.impl.RaftNodeImpl in project hazelcast by hazelcast.
the class LocalRaftIntegration method send.
@Override
public boolean send(VoteResponse response, RaftEndpoint target) {
assertNotEquals(localEndpoint, target);
RaftNodeImpl node = nodes.get(target);
if (node == null) {
return false;
}
if (shouldDrop(response, target)) {
return true;
}
node.handleVoteResponse(alterMessageIfNeeded(response, target));
return true;
}
Aggregations