Search in sources :

Example 1 with TimeLockInstallConfiguration

use of com.palantir.timelock.config.TimeLockInstallConfiguration in project atlasdb by palantir.

the class TimeLockConfigMigrator method convert.

public static CombinedTimeLockServerConfiguration convert(TimeLockServerConfiguration config, Environment environment) {
    // taking advantage of the fact that there is only one algorithm impl at the moment
    Preconditions.checkArgument(PaxosConfiguration.class.isInstance(config.algorithm()), "Paxos is the only leader election algorithm currently supported. Not: %s", config.algorithm().getClass());
    PaxosConfiguration paxos = (PaxosConfiguration) config.algorithm();
    TimeLockInstallConfiguration install = ImmutableTimeLockInstallConfiguration.builder().timestampBoundPersistence(config.getTsBoundPersisterConfiguration()).paxos(ImmutablePaxosInstallConfiguration.builder().dataDirectory(paxos.paxosDataDir()).build()).cluster(ImmutableDefaultClusterConfiguration.builder().cluster(PartialServiceConfiguration.builder().security(paxos.sslConfiguration()).uris(config.cluster().servers()).build()).localServer(config.cluster().localServer()).build()).asyncLock(config.asyncLockConfiguration()).build();
    TimeLockRuntimeConfiguration runtime = ImmutableTimeLockRuntimeConfiguration.builder().paxos(ImmutablePaxosRuntimeConfiguration.builder().leaderPingResponseWaitMs(paxos.leaderPingResponseWaitMs()).maximumWaitBeforeProposalMs(paxos.maximumWaitBeforeProposalMs()).pingRateMs(paxos.pingRateMs()).build()).slowLockLogTriggerMillis(config.slowLockLogTriggerMillis()).build();
    TimeLockDeprecatedConfiguration deprecated = createDeprecatedConfiguration(config, environment);
    return ImmutableCombinedTimeLockServerConfiguration.builder().install(install).runtime(runtime).deprecated(deprecated).build();
}
Also used : TimeLockInstallConfiguration(com.palantir.timelock.config.TimeLockInstallConfiguration) ImmutableTimeLockInstallConfiguration(com.palantir.timelock.config.ImmutableTimeLockInstallConfiguration) ImmutableTimeLockDeprecatedConfiguration(com.palantir.timelock.config.ImmutableTimeLockDeprecatedConfiguration) TimeLockDeprecatedConfiguration(com.palantir.timelock.config.TimeLockDeprecatedConfiguration) TimeLockRuntimeConfiguration(com.palantir.timelock.config.TimeLockRuntimeConfiguration) ImmutableTimeLockRuntimeConfiguration(com.palantir.timelock.config.ImmutableTimeLockRuntimeConfiguration)

Aggregations

ImmutableTimeLockDeprecatedConfiguration (com.palantir.timelock.config.ImmutableTimeLockDeprecatedConfiguration)1 ImmutableTimeLockInstallConfiguration (com.palantir.timelock.config.ImmutableTimeLockInstallConfiguration)1 ImmutableTimeLockRuntimeConfiguration (com.palantir.timelock.config.ImmutableTimeLockRuntimeConfiguration)1 TimeLockDeprecatedConfiguration (com.palantir.timelock.config.TimeLockDeprecatedConfiguration)1 TimeLockInstallConfiguration (com.palantir.timelock.config.TimeLockInstallConfiguration)1 TimeLockRuntimeConfiguration (com.palantir.timelock.config.TimeLockRuntimeConfiguration)1