Search in sources :

Example 1 with ServiceDiscoveringAtlasSupplier

use of com.palantir.atlasdb.factory.ServiceDiscoveringAtlasSupplier in project atlasdb by palantir.

the class DbBoundTimestampCreator method createTimestampService.

@Override
public Supplier<ManagedTimestampService> createTimestampService(String client, LeaderConfig leaderConfig) {
    ServiceDiscoveringAtlasSupplier atlasFactory = new ServiceDiscoveringAtlasSupplier(kvsConfig, Optional.of(leaderConfig), Optional.empty(), Optional.of(AtlasDbConstants.TIMELOCK_TIMESTAMP_TABLE));
    TimestampService timestampService = atlasFactory.getTimestampService();
    Preconditions.checkArgument(TimestampManagementService.class.isInstance(timestampService), "The timestamp service is not a managed timestamp service.");
    return () -> new DelegatingManagedTimestampService(timestampService, (TimestampManagementService) timestampService);
}
Also used : ServiceDiscoveringAtlasSupplier(com.palantir.atlasdb.factory.ServiceDiscoveringAtlasSupplier) TimestampManagementService(com.palantir.timestamp.TimestampManagementService) DelegatingManagedTimestampService(com.palantir.atlasdb.timelock.paxos.DelegatingManagedTimestampService) ManagedTimestampService(com.palantir.atlasdb.timelock.paxos.ManagedTimestampService) TimestampService(com.palantir.timestamp.TimestampService) DelegatingManagedTimestampService(com.palantir.atlasdb.timelock.paxos.DelegatingManagedTimestampService)

Aggregations

ServiceDiscoveringAtlasSupplier (com.palantir.atlasdb.factory.ServiceDiscoveringAtlasSupplier)1 DelegatingManagedTimestampService (com.palantir.atlasdb.timelock.paxos.DelegatingManagedTimestampService)1 ManagedTimestampService (com.palantir.atlasdb.timelock.paxos.ManagedTimestampService)1 TimestampManagementService (com.palantir.timestamp.TimestampManagementService)1 TimestampService (com.palantir.timestamp.TimestampService)1