rpcClient = this.server.context.getRpcClientFactory().createRpcClient(leader.getEndpoint()); this.rpcClients.put(leaderId, rpcClient);
rpcClient = this.server.context.getRpcClientFactory().createRpcClient(leader.getEndpoint()); this.rpcClients.put(leaderId, rpcClient);
rpcClient = this.server.context.getRpcClientFactory().createRpcClient(leader.getEndpoint()); this.rpcClients.put(leaderId, rpcClient);
public PeerServer(ClusterServer server, RaftContext context, final Consumer<PeerServer> heartbeatConsumer){ this.clusterConfig = server; this.rpcClient = context.getRpcClientFactory().createRpcClient(server.getEndpoint()); this.busyFlag = new AtomicInteger(0); this.pendingCommitFlag = new AtomicInteger(0); this.heartbeatInterval = this.currentHeartbeatInterval = context.getRaftParameters().getHeartbeatInterval(); this.maxHeartbeatInterval = context.getRaftParameters().getMaxHeartbeatInterval(); this.rpcBackoffInterval = context.getRaftParameters().getRpcFailureBackoff(); this.heartbeatTask = null; this.snapshotSyncContext = null; this.nextLogIndex = 1; this.matchedIndex = 0; this.heartbeatEnabled = false; this.executor = context.getScheduledExecutor(); PeerServer self = this; this.heartbeatTimeoutHandler = new Callable<Void>(){ @Override public Void call() throws Exception { heartbeatConsumer.accept(self); return null; }}; }
public PeerServer(ClusterServer server, RaftContext context, final Consumer<PeerServer> heartbeatConsumer){ this.clusterConfig = server; this.rpcClient = context.getRpcClientFactory().createRpcClient(server.getEndpoint()); this.busyFlag = new AtomicInteger(0); this.pendingCommitFlag = new AtomicInteger(0); this.heartbeatInterval = this.currentHeartbeatInterval = context.getRaftParameters().getHeartbeatInterval(); this.maxHeartbeatInterval = context.getRaftParameters().getMaxHeartbeatInterval(); this.rpcBackoffInterval = context.getRaftParameters().getRpcFailureBackoff(); this.heartbeatTask = null; this.snapshotSyncContext = null; this.nextLogIndex = 1; this.matchedIndex = 0; this.heartbeatEnabled = false; this.executor = context.getScheduledExecutor(); PeerServer self = this; this.heartbeatTimeoutHandler = new Callable<Void>(){ @Override public Void call() throws Exception { heartbeatConsumer.accept(self); return null; }}; }
public PeerServer(ClusterServer server, RaftContext context, final Consumer<PeerServer> heartbeatConsumer){ this.clusterConfig = server; this.rpcClient = context.getRpcClientFactory().createRpcClient(server.getEndpoint()); this.busyFlag = new AtomicInteger(0); this.pendingCommitFlag = new AtomicInteger(0); this.heartbeatInterval = this.currentHeartbeatInterval = context.getRaftParameters().getHeartbeatInterval(); this.maxHeartbeatInterval = context.getRaftParameters().getMaxHeartbeatInterval(); this.rpcBackoffInterval = context.getRaftParameters().getRpcFailureBackoff(); this.heartbeatTask = null; this.snapshotSyncContext = null; this.nextLogIndex = 1; this.matchedIndex = 0; this.heartbeatEnabled = false; this.executor = context.getScheduledExecutor(); PeerServer self = this; this.heartbeatTimeoutHandler = new Callable<Void>(){ @Override public Void call() throws Exception { heartbeatConsumer.accept(self); return null; }}; }