Search in sources :

Example 1 with ImmutableLeaderConfig

use of com.palantir.atlasdb.config.ImmutableLeaderConfig in project atlasdb by palantir.

the class TimeLockAgent method createInvalidatingTimeLockServices.

/**
 * Creates timestamp and lock services for the given client. It is expected that for each client there should
 * only be (up to) one active timestamp service, and one active lock service at any time.
 * @param client Client namespace to create the services for
 * @return Invalidating timestamp and lock services
 */
private TimeLockServices createInvalidatingTimeLockServices(String client) {
    List<String> uris = install.cluster().clusterMembers();
    ImmutableLeaderConfig leaderConfig = ImmutableLeaderConfig.builder().addLeaders(uris.toArray(new String[uris.size()])).localServer(install.cluster().localServer()).sslConfiguration(PaxosRemotingUtils.getSslConfigurationOptional(install)).quorumSize(PaxosRemotingUtils.getQuorumSize(uris)).build();
    Supplier<ManagedTimestampService> rawTimestampServiceSupplier = timestampCreator.createTimestampService(client, leaderConfig);
    Supplier<LockService> rawLockServiceSupplier = lockCreator::createThreadPoolingLockService;
    LockLog.setSlowLockThresholdMillis(JavaSuppliers.compose(TimeLockRuntimeConfiguration::slowLockLogTriggerMillis, runtime));
    return timelockCreator.createTimeLockServices(client, rawTimestampServiceSupplier, rawLockServiceSupplier);
}
Also used : LockService(com.palantir.lock.LockService) ManagedTimestampService(com.palantir.atlasdb.timelock.paxos.ManagedTimestampService) ImmutableLeaderConfig(com.palantir.atlasdb.config.ImmutableLeaderConfig)

Aggregations

ImmutableLeaderConfig (com.palantir.atlasdb.config.ImmutableLeaderConfig)1 ManagedTimestampService (com.palantir.atlasdb.timelock.paxos.ManagedTimestampService)1 LockService (com.palantir.lock.LockService)1