Search in sources :

Example 1 with Puncher

use of com.palantir.atlasdb.cleaner.Puncher in project atlasdb by palantir.

the class TestTimestampCommand method punch.

private void punch(TestAtlasDbServices services, TimestampService tss, Clock clock) {
    // this is a really hacky way of forcing a punch to test the datetime output
    Uninterruptibles.sleepUninterruptibly(2, TimeUnit.MILLISECONDS);
    long punchTs = tss.getFreshTimestamps(1000).getUpperBound();
    PuncherStore puncherStore = KeyValueServicePuncherStore.create(services.getKeyValueService());
    Puncher puncher = SimplePuncher.create(puncherStore, clock, Suppliers.ofInstance(AtlasDbConstants.DEFAULT_TRANSACTION_READ_TIMEOUT));
    puncher.punch(punchTs);
    Uninterruptibles.sleepUninterruptibly(2, TimeUnit.MILLISECONDS);
}
Also used : KeyValueServicePuncherStore(com.palantir.atlasdb.cleaner.KeyValueServicePuncherStore) PuncherStore(com.palantir.atlasdb.cleaner.PuncherStore) Puncher(com.palantir.atlasdb.cleaner.Puncher) SimplePuncher(com.palantir.atlasdb.cleaner.SimplePuncher)

Aggregations

KeyValueServicePuncherStore (com.palantir.atlasdb.cleaner.KeyValueServicePuncherStore)1 Puncher (com.palantir.atlasdb.cleaner.Puncher)1 PuncherStore (com.palantir.atlasdb.cleaner.PuncherStore)1 SimplePuncher (com.palantir.atlasdb.cleaner.SimplePuncher)1