Search in sources :

Example 26 with TimestampService

use of com.palantir.timestamp.TimestampService in project atlasdb by palantir.

the class FastForwardTimestamp method executeTimestampCommand.

@Override
protected int executeTimestampCommand(AtlasDbServices services) {
    printer.warn("This CLI has been deprecated. Please use the timestamp-management/fast-forward endpoint instead.");
    TimestampService ts = services.getTimestampService();
    if (!(ts instanceof TimestampManagementService)) {
        printer.error("Timestamp service must be of type {}, but yours is {}.  Exiting.", SafeArg.of("expected type", TimestampManagementService.class.toString()), SafeArg.of("found type", ts.getClass().toString()));
        return 1;
    }
    TimestampManagementService tms = (TimestampManagementService) ts;
    tms.fastForwardTimestamp(timestamp);
    printer.info("Timestamp successfully fast-forwarded to {}", SafeArg.of("timestamp", timestamp));
    return 0;
}
Also used : TimestampManagementService(com.palantir.timestamp.TimestampManagementService) TimestampService(com.palantir.timestamp.TimestampService)

Aggregations

TimestampService (com.palantir.timestamp.TimestampService)26 Test (org.junit.Test)12 InMemoryTimestampService (com.palantir.timestamp.InMemoryTimestampService)7 SerializableTransactionManager (com.palantir.atlasdb.transaction.impl.SerializableTransactionManager)6 LockService (com.palantir.lock.LockService)6 SingleBackendCliTestRunner (com.palantir.atlasdb.cli.runner.SingleBackendCliTestRunner)5 KeyValueService (com.palantir.atlasdb.keyvalue.api.KeyValueService)5 DaggerTestAtlasDbServices (com.palantir.atlasdb.services.test.DaggerTestAtlasDbServices)5 TestAtlasDbServices (com.palantir.atlasdb.services.test.TestAtlasDbServices)5 LockRefreshingLockService (com.palantir.lock.client.LockRefreshingLockService)4 Before (org.junit.Before)4 KvsBackedPersistentLockService (com.palantir.atlasdb.persistentlock.KvsBackedPersistentLockService)3 NoOpPersistentLockService (com.palantir.atlasdb.persistentlock.NoOpPersistentLockService)3 PersistentLockService (com.palantir.atlasdb.persistentlock.PersistentLockService)3 SweepStrategyManager (com.palantir.atlasdb.transaction.impl.SweepStrategyManager)3 TransactionService (com.palantir.atlasdb.transaction.service.TransactionService)3 LockClient (com.palantir.lock.LockClient)3 LegacyTimelockService (com.palantir.lock.impl.LegacyTimelockService)3 TimestampManagementService (com.palantir.timestamp.TimestampManagementService)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2