Search in sources :

Example 11 with InMemoryAtlasDbConfig

use of com.palantir.atlasdb.memory.InMemoryAtlasDbConfig in project atlasdb by palantir.

the class TransactionManagersTest method runsClosingCallbackOnShutdown.

@Test
public void runsClosingCallbackOnShutdown() throws Exception {
    AtlasDbConfig atlasDbConfig = ImmutableAtlasDbConfig.builder().keyValueService(new InMemoryAtlasDbConfig()).defaultLockTimeoutSeconds(120).build();
    Runnable callback = mock(Runnable.class);
    SerializableTransactionManager manager = TransactionManagers.builder().config(atlasDbConfig).userAgent("test").globalMetricsRegistry(new MetricRegistry()).globalTaggedMetricRegistry(DefaultTaggedMetricRegistry.getDefault()).registrar(environment).build().serializable();
    manager.registerClosingCallback(callback);
    manager.close();
    verify(callback, times(1)).run();
}
Also used : DefaultTaggedMetricRegistry(com.palantir.tritium.metrics.registry.DefaultTaggedMetricRegistry) MetricRegistry(com.codahale.metrics.MetricRegistry) SerializableTransactionManager(com.palantir.atlasdb.transaction.impl.SerializableTransactionManager) ImmutableAtlasDbConfig(com.palantir.atlasdb.config.ImmutableAtlasDbConfig) InMemoryAtlasDbConfig(com.palantir.atlasdb.memory.InMemoryAtlasDbConfig) AtlasDbConfig(com.palantir.atlasdb.config.AtlasDbConfig) InMemoryAtlasDbConfig(com.palantir.atlasdb.memory.InMemoryAtlasDbConfig) Test(org.junit.Test)

Example 12 with InMemoryAtlasDbConfig

use of com.palantir.atlasdb.memory.InMemoryAtlasDbConfig in project atlasdb by palantir.

the class DatabaseTsBoundPersisterConfigurationTest method canCreateWithInMemoryKvsConfig.

@Test
public void canCreateWithInMemoryKvsConfig() {
    DatabaseTsBoundPersisterConfiguration config = ImmutableDatabaseTsBoundPersisterConfiguration.builder().keyValueServiceConfig(new InMemoryAtlasDbConfig()).build();
    assertThat(config).isNotNull();
}
Also used : ImmutableDatabaseTsBoundPersisterConfiguration(com.palantir.timelock.config.ImmutableDatabaseTsBoundPersisterConfiguration) DatabaseTsBoundPersisterConfiguration(com.palantir.timelock.config.DatabaseTsBoundPersisterConfiguration) InMemoryAtlasDbConfig(com.palantir.atlasdb.memory.InMemoryAtlasDbConfig) Test(org.junit.Test)

Example 13 with InMemoryAtlasDbConfig

use of com.palantir.atlasdb.memory.InMemoryAtlasDbConfig in project atlasdb by palantir.

the class TimestampBoundStoreConfigDeserializationTest method assertTimestampBoundPersisterConfigurationCorrect.

@Override
public void assertTimestampBoundPersisterConfigurationCorrect(TsBoundPersisterConfiguration configuration) {
    assertThat(configuration).isInstanceOf(DatabaseTsBoundPersisterConfiguration.class);
    DatabaseTsBoundPersisterConfiguration databaseTsBoundPersisterConfiguration = (DatabaseTsBoundPersisterConfiguration) configuration;
    assertThat(databaseTsBoundPersisterConfiguration.keyValueServiceConfig()).isEqualTo(new InMemoryAtlasDbConfig());
}
Also used : DatabaseTsBoundPersisterConfiguration(com.palantir.timelock.config.DatabaseTsBoundPersisterConfiguration) InMemoryAtlasDbConfig(com.palantir.atlasdb.memory.InMemoryAtlasDbConfig)

Aggregations

InMemoryAtlasDbConfig (com.palantir.atlasdb.memory.InMemoryAtlasDbConfig)13 Test (org.junit.Test)10 AtlasDbConfig (com.palantir.atlasdb.config.AtlasDbConfig)5 ImmutableAtlasDbConfig (com.palantir.atlasdb.config.ImmutableAtlasDbConfig)5 MetricRegistry (com.codahale.metrics.MetricRegistry)4 DefaultTaggedMetricRegistry (com.palantir.tritium.metrics.registry.DefaultTaggedMetricRegistry)4 SerializableTransactionManager (com.palantir.atlasdb.transaction.impl.SerializableTransactionManager)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 AtlasDbRuntimeConfig (com.palantir.atlasdb.config.AtlasDbRuntimeConfig)2 ImmutableServerListConfig (com.palantir.atlasdb.config.ImmutableServerListConfig)2 ImmutableTimeLockClientConfig (com.palantir.atlasdb.config.ImmutableTimeLockClientConfig)2 DatabaseTsBoundPersisterConfiguration (com.palantir.timelock.config.DatabaseTsBoundPersisterConfiguration)2 List (java.util.List)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 MappingBuilder (com.github.tomakehurst.wiremock.client.MappingBuilder)1 WireMock (com.github.tomakehurst.wiremock.client.WireMock)1 WireMock.aResponse (com.github.tomakehurst.wiremock.client.WireMock.aResponse)1 WireMock.get (com.github.tomakehurst.wiremock.client.WireMock.get)1 WireMock.getRequestedFor (com.github.tomakehurst.wiremock.client.WireMock.getRequestedFor)1 WireMock.post (com.github.tomakehurst.wiremock.client.WireMock.post)1