use of com.palantir.atlasdb.http.NotCurrentLeaderExceptionMapper in project atlasdb by palantir.
the class Leaders method createAndRegisterLocalServices.
/**
* Creates a LeaderElectionService using the supplied configuration and registers appropriate endpoints for that
* service.
*/
public static LocalPaxosServices createAndRegisterLocalServices(MetricsManager metricsManager, Consumer<Object> env, LeaderConfig config, UserAgent userAgent) {
LocalPaxosServices localPaxosServices = createInstrumentedLocalServices(metricsManager, config, userAgent);
env.accept(localPaxosServices.ourAcceptor());
env.accept(localPaxosServices.ourLearner());
env.accept(localPaxosServices.localPingableLeader());
env.accept(new NotCurrentLeaderExceptionMapper());
return localPaxosServices;
}
use of com.palantir.atlasdb.http.NotCurrentLeaderExceptionMapper in project atlasdb by palantir.
the class TimeLockAgent method registerExceptionMappers.
private void registerExceptionMappers() {
registrar.accept(new BlockingTimeoutExceptionMapper());
registrar.accept(new NotCurrentLeaderExceptionMapper(redirectRetryTargeter()));
registrar.accept(new TooManyRequestsExceptionMapper());
}
use of com.palantir.atlasdb.http.NotCurrentLeaderExceptionMapper in project atlasdb by palantir.
the class Leaders method createAndRegisterLocalServices.
public static LocalPaxosServices createAndRegisterLocalServices(Consumer<Object> env, LeaderConfig config, Supplier<LeaderRuntimeConfig> runtime, String userAgent) {
LocalPaxosServices localPaxosServices = createInstrumentedLocalServices(config, runtime, userAgent);
env.accept(localPaxosServices.ourAcceptor());
env.accept(localPaxosServices.ourLearner());
env.accept(localPaxosServices.pingableLeader());
env.accept(new NotCurrentLeaderExceptionMapper());
return localPaxosServices;
}
Aggregations