use of com.palantir.atlasdb.memory.InMemoryAtlasDbConfig in project atlasdb by palantir.
the class TimeLockTestUtils method createTransactionManager.
static SerializableTransactionManager createTransactionManager(TestableTimelockCluster cluster) {
List<String> serverUris = cluster.servers().stream().map(server -> server.serverHolder().getTimelockUri()).collect(Collectors.toList());
AtlasDbConfig config = ImmutableAtlasDbConfig.builder().namespace("test").keyValueService(new InMemoryAtlasDbConfig()).timelock(ImmutableTimeLockClientConfig.builder().serversList(ImmutableServerListConfig.builder().servers(serverUris).sslConfiguration(SslConfiguration.of(Paths.get("var/security/trustStore.jks"))).build()).build()).build();
return TransactionManagers.builder().config(config).userAgent("test").globalMetricsRegistry(new MetricRegistry()).globalTaggedMetricRegistry(DefaultTaggedMetricRegistry.getDefault()).build().serializable();
}
use of com.palantir.atlasdb.memory.InMemoryAtlasDbConfig in project atlasdb by palantir.
the class AtlasDbConfigTest method inMemoryConfigWorksWithNonTestNamespace.
@Test
public void inMemoryConfigWorksWithNonTestNamespace() {
InMemoryAtlasDbConfig kvsConfig = new InMemoryAtlasDbConfig();
assertFalse("This test assumes the InMemoryAtlasDbConfig has no namespace by default", kvsConfig.namespace().isPresent());
AtlasDbConfig config = ImmutableAtlasDbConfig.builder().namespace("clive").keyValueService(kvsConfig).build();
assertThat(config.getNamespaceString(), equalTo("clive"));
}
use of com.palantir.atlasdb.memory.InMemoryAtlasDbConfig in project atlasdb by palantir.
the class AtlasDbConfigTest method inMemoryKeyspaceAndTimelockClientCanBeDifferent.
// Documenting that for in-memory, we don't care what the timelock client is - it just has to be non-empty.
@Test
public void inMemoryKeyspaceAndTimelockClientCanBeDifferent() {
InMemoryAtlasDbConfig kvsConfig = new InMemoryAtlasDbConfig();
assertFalse("This test assumes the InMemoryAtlasDbConfig has no namespace by default", kvsConfig.namespace().isPresent());
ImmutableAtlasDbConfig config = ImmutableAtlasDbConfig.builder().keyValueService(kvsConfig).timelock(TIMELOCK_CONFIG_WITH_OTHER_CLIENT).build();
assertThat(config.getNamespaceString(), equalTo(OTHER_CLIENT));
}
use of com.palantir.atlasdb.memory.InMemoryAtlasDbConfig in project atlasdb by palantir.
the class TransactionManagersTest method keyValueServiceMetricsDoNotContainUserAgent.
@Test
public void keyValueServiceMetricsDoNotContainUserAgent() {
AtlasDbConfig atlasDbConfig = ImmutableAtlasDbConfig.builder().keyValueService(new InMemoryAtlasDbConfig()).build();
TransactionManagers.builder().config(atlasDbConfig).userAgent("test").globalMetricsRegistry(new MetricRegistry()).globalTaggedMetricRegistry(DefaultTaggedMetricRegistry.getDefault()).registrar(environment).build().serializable();
assertThat(metricsRule.metrics().getNames().stream().anyMatch(metricName -> metricName.contains(USER_AGENT_NAME)), is(false));
}
use of com.palantir.atlasdb.memory.InMemoryAtlasDbConfig in project atlasdb by palantir.
the class AtlasDbConfigDeserializationTest method canDeserializeMinimalAtlasDbConfig.
@Test
public void canDeserializeMinimalAtlasDbConfig() throws IOException {
AtlasDbConfig config = AtlasDbConfigs.load(MINIMAL_TEST_CONFIG_FILE, AtlasDbConfig.class);
assertThat(config.namespace().isPresent()).isFalse();
assertThat(config.keyValueService()).isEqualTo(new InMemoryAtlasDbConfig());
assertThat(config.timelock().isPresent()).isFalse();
assertThat(config.leader().isPresent()).isFalse();
assertThat(config.enableSweep()).isEqualTo(AtlasDbConstants.DEFAULT_ENABLE_SWEEP);
}
Aggregations