Search in sources :

Example 1 with NotCurrentLeaderExceptionMapper

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;
}
Also used : NotCurrentLeaderExceptionMapper(com.palantir.atlasdb.http.NotCurrentLeaderExceptionMapper)

Example 2 with NotCurrentLeaderExceptionMapper

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());
}
Also used : TooManyRequestsExceptionMapper(com.palantir.atlasdb.timelock.TooManyRequestsExceptionMapper) BlockingTimeoutExceptionMapper(com.palantir.atlasdb.http.BlockingTimeoutExceptionMapper) NotCurrentLeaderExceptionMapper(com.palantir.atlasdb.http.NotCurrentLeaderExceptionMapper)

Example 3 with NotCurrentLeaderExceptionMapper

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;
}
Also used : NotCurrentLeaderExceptionMapper(com.palantir.atlasdb.http.NotCurrentLeaderExceptionMapper)

Aggregations

NotCurrentLeaderExceptionMapper (com.palantir.atlasdb.http.NotCurrentLeaderExceptionMapper)3 BlockingTimeoutExceptionMapper (com.palantir.atlasdb.http.BlockingTimeoutExceptionMapper)1 TooManyRequestsExceptionMapper (com.palantir.atlasdb.timelock.TooManyRequestsExceptionMapper)1