Search in sources :

Example 1 with ReplicatorGroup

use of com.alipay.sofa.jraft.ReplicatorGroup in project sofa-jraft by sofastack.

the class GrpcClient method notifyReady.

private void notifyReady(final Endpoint endpoint) {
    LOG.info("The channel {} has successfully established.", endpoint);
    clearConnFailuresCount(endpoint);
    final ReplicatorGroup rpGroup = this.replicatorGroup;
    if (rpGroup != null) {
        try {
            RpcUtils.runInThread(() -> {
                final PeerId peer = new PeerId();
                if (peer.parse(endpoint.toString())) {
                    LOG.info("Peer {} is connected.", peer);
                    rpGroup.checkReplicator(peer, true);
                } else {
                    LOG.error("Fail to parse peer: {}.", endpoint);
                }
            });
        } catch (final Throwable t) {
            LOG.error("Fail to check replicator {}.", endpoint, t);
        }
    }
}
Also used : ReplicatorGroup(com.alipay.sofa.jraft.ReplicatorGroup) PeerId(com.alipay.sofa.jraft.entity.PeerId)

Aggregations

ReplicatorGroup (com.alipay.sofa.jraft.ReplicatorGroup)1 PeerId (com.alipay.sofa.jraft.entity.PeerId)1