Search in sources :

Example 1 with DelegatingManagedTimestampService

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);
}
Also used : DelegatingManagedTimestampService(com.palantir.atlasdb.timelock.paxos.DelegatingManagedTimestampService) TimestampBoundStore(com.palantir.timestamp.TimestampBoundStore) PaxosTimestampBoundStore(com.palantir.atlasdb.timelock.paxos.PaxosTimestampBoundStore) PaxosTimestampBoundStore(com.palantir.atlasdb.timelock.paxos.PaxosTimestampBoundStore) PersistentTimestampService(com.palantir.timestamp.PersistentTimestampService)

Example 2 with DelegatingManagedTimestampService

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);
}
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

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