Search in sources :

Example 1 with LeaderConfig

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()));
}
Also used : LeadershipResource(com.palantir.atlasdb.timelock.paxos.LeadershipResource) Leaders(com.palantir.atlasdb.factory.Leaders) LeaderConfig(com.palantir.atlasdb.config.LeaderConfig) ImmutableLeaderConfig(com.palantir.atlasdb.config.ImmutableLeaderConfig)

Aggregations

ImmutableLeaderConfig (com.palantir.atlasdb.config.ImmutableLeaderConfig)1 LeaderConfig (com.palantir.atlasdb.config.LeaderConfig)1 Leaders (com.palantir.atlasdb.factory.Leaders)1 LeadershipResource (com.palantir.atlasdb.timelock.paxos.LeadershipResource)1