use of com.palantir.atlasdb.timelock.paxos.DelegatingManagedTimestampService in project atlasdb by palantir.
the class PaxosTimestampCreator method createManagedPaxosTimestampService.
private ManagedTimestampService createManagedPaxosTimestampService(PaxosProposer proposer, String client, List<PaxosAcceptor> acceptors, List<PaxosLearner> learners) {
// TODO (jkong): live reload ping
TimestampBoundStore boundStore = instrument(TimestampBoundStore.class, new PaxosTimestampBoundStore(proposer, paxosResource.getPaxosLearner(client), ImmutableList.copyOf(acceptors), ImmutableList.copyOf(learners), paxosRuntime.get().maximumWaitBeforeProposalMs()), client);
PersistentTimestampService persistentTimestampService = PersistentTimestampServiceImpl.create(boundStore);
return new DelegatingManagedTimestampService(persistentTimestampService, persistentTimestampService);
}
use of com.palantir.atlasdb.timelock.paxos.DelegatingManagedTimestampService 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);
}
Aggregations