use of com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService in project atlasdb by palantir.
the class SweepProgressStoreTest method setup.
@Before
public void setup() {
exec = PTExecutors.newCachedThreadPool();
KeyValueService kvs = new InMemoryKeyValueService(false, exec);
txManager = SweepTestUtils.setupTxManager(kvs);
progressStore = SweepProgressStoreImpl.create(kvs, false);
}
use of com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService in project atlasdb by palantir.
the class PuncherTest method parameters.
@Parameters
public static Collection<Object[]> parameters() {
InMemoryKeyValueService kvsPuncherStoreKvs = new InMemoryKeyValueService(false);
InMemoryKeyValueService cachingKvsPuncherStoreKvs = new InMemoryKeyValueService(false);
InMemoryPuncherStore inMemoryPuncherStore = InMemoryPuncherStore.create();
PuncherStore puncherStore = KeyValueServicePuncherStore.create(kvsPuncherStoreKvs);
CachingPuncherStore cachingInMemoryPuncherStore = CachingPuncherStore.create(InMemoryPuncherStore.create(), GRANULARITY_MILLIS);
CachingPuncherStore cachingKeyValueServicePuncherStore = CachingPuncherStore.create(KeyValueServicePuncherStore.create(cachingKvsPuncherStoreKvs), GRANULARITY_MILLIS);
Object[][] parameters = new Object[][] { { inMemoryPuncherStore, null }, { puncherStore, kvsPuncherStoreKvs }, { cachingInMemoryPuncherStore, null }, { cachingKeyValueServicePuncherStore, cachingKvsPuncherStoreKvs } };
return ImmutableList.copyOf(parameters);
}
use of com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService in project atlasdb by palantir.
the class ScrubberTest method before.
@Before
public void before() {
kvs = new InMemoryKeyValueService(false, MoreExecutors.newDirectExecutorService());
kvs.createTable(TransactionConstants.TRANSACTION_TABLE, new byte[] {});
transactions = new SimpleTransactionService(kvs);
scrubStore = KeyValueServiceScrubberStore.create(kvs);
scrubber = getScrubber(kvs, scrubStore, transactions);
}
use of com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService in project atlasdb by palantir.
the class SchemaMetadataServiceImplTest method canInitializeAsynchronously.
@Test
public void canInitializeAsynchronously() {
ForwardingKeyValueService forwardingKeyValueService = new ForwardingKeyValueService() {
private KeyValueService realKeyValueService = new InMemoryKeyValueService(true);
private boolean fail = true;
@Override
protected KeyValueService delegate() {
if (fail) {
fail = false;
return mock(KeyValueService.class, (Answer) invocation -> {
throw new RuntimeException("I am unhappy");
});
}
return realKeyValueService;
}
};
SchemaMetadataService metadataService = SchemaMetadataServiceImpl.create(forwardingKeyValueService, true);
assertThatThrownBy(() -> metadataService.putSchemaMetadata(SCHEMA_NAME_ONE, SCHEMA_METADATA_ONE)).isInstanceOf(NotInitializedException.class);
Awaitility.await().atMost(30, TimeUnit.SECONDS).pollInterval(1, TimeUnit.SECONDS).until(metadataService::isInitialized);
metadataService.putSchemaMetadata(SCHEMA_NAME_ONE, SCHEMA_METADATA_ONE);
assertThat(metadataService.loadSchemaMetadata(SCHEMA_NAME_ONE)).contains(SCHEMA_METADATA_ONE);
}
use of com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService in project atlasdb by palantir.
the class KeyValueServicePuncherStoreTest method initializePuncherStore.
private static PuncherStore initializePuncherStore(Map<Long, Long> timestampMap) {
PuncherStore puncherStore = KeyValueServicePuncherStore.create(new InMemoryKeyValueService(false));
timestampMap.forEach((key, value) -> puncherStore.put(key, value));
return puncherStore;
}
Aggregations