use of com.palantir.atlasdb.config.LeaderConfig in project atlasdb by palantir.
the class PaxosLeadershipCreator method registerLeaderElectionService.
public void registerLeaderElectionService() {
Set<String> remoteServers = PaxosRemotingUtils.getRemoteServerPaths(install);
LeaderConfig leaderConfig = getLeaderConfig();
Set<String> paxosSubresourceUris = PaxosTimeLockUriUtils.getLeaderPaxosUris(remoteServers);
Leaders.LocalPaxosServices localPaxosServices = Leaders.createInstrumentedLocalServices(leaderConfig, JavaSuppliers.compose(getLeaderRuntimeConfig, runtime), ImmutableRemotePaxosServerSpec.builder().remoteLeaderUris(remoteServers).remoteAcceptorUris(paxosSubresourceUris).remoteLearnerUris(paxosSubresourceUris).build(), "leader-election-service");
leaderElectionService = localPaxosServices.leaderElectionService();
registrar.accept(localPaxosServices.pingableLeader());
registrar.accept(new LeadershipResource(localPaxosServices.ourAcceptor(), localPaxosServices.ourLearner()));
}
Aggregations