Search in sources :

Example 6 with FollowerInfo

use of org.apache.ratis.server.leader.FollowerInfo in project incubator-ratis by apache.

the class LeaderStateImpl method restart.

@Override
public void restart(LogAppender sender) {
    final FollowerInfo follower = sender.getFollower();
    LOG.info("{}: Restarting {} for {}", this, JavaUtils.getClassSimpleName(sender.getClass()), follower.getName());
    sender.stop();
    senders.removeAll(Collections.singleton(sender));
    addAndStartSenders(Collections.singleton(follower.getPeer()));
}
Also used : FollowerInfo(org.apache.ratis.server.leader.FollowerInfo)

Aggregations

FollowerInfo (org.apache.ratis.server.leader.FollowerInfo)6 RaftPeerId (org.apache.ratis.protocol.RaftPeerId)3 LogAppender (org.apache.ratis.server.leader.LogAppender)3 TermIndex (org.apache.ratis.server.protocol.TermIndex)3 ArrayList (java.util.ArrayList)2 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)2 RaftPeer (org.apache.ratis.protocol.RaftPeer)2 IOException (java.io.IOException)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Objects (java.util.Objects)1 Optional (java.util.Optional)1 ArrayBlockingQueue (java.util.concurrent.ArrayBlockingQueue)1 BlockingQueue (java.util.concurrent.BlockingQueue)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 CompletionException (java.util.concurrent.CompletionException)1