Search in sources :

Example 1 with AtlasDbConfig

use of com.palantir.atlasdb.config.AtlasDbConfig in project atlasdb by palantir.

the class AtlasDbConsoleCommand method run.

@Override
protected void run(Bootstrap<T> bootstrap, Namespace namespace, T configuration) throws JsonProcessingException {
    AtlasDbConfig cliConfiguration = AtlasDbCommandUtils.convertServerConfigToClientConfig(configuration.getAtlasDbConfig(), configuration.getAtlasDbRuntimeConfig());
    // cluster in atlasdb-console (since this is passed in through bind)
    if (isCliRunningOffline(namespace)) {
        cliConfiguration = cliConfiguration.toOfflineConfig();
    }
    List<String> allArgs = ImmutableList.<String>builder().add("--bind").add("dropwizardAtlasDb").add(AtlasDbCommandUtils.serialiseConfiguration(cliConfiguration)).add("--evaluate").add("connectInline dropwizardAtlasDb").addAll(AtlasDbCommandUtils.gatherPassedInArguments(namespace.getAttrs())).build();
    runAtlasDbConsole(allArgs);
}
Also used : AtlasDbConfig(com.palantir.atlasdb.config.AtlasDbConfig)

Example 2 with AtlasDbConfig

use of com.palantir.atlasdb.config.AtlasDbConfig in project atlasdb by palantir.

the class AtlasDbCommandUtilsTest method lockBlockExistsAfterConvertingConfig.

@Test
public void lockBlockExistsAfterConvertingConfig() {
    AtlasDbConfig clientConfig = AtlasDbCommandUtils.convertServerConfigToClientConfig(minimalLeaderConfig, Optional.of(EMPTY_RUNTIME_CONFIG));
    assertThat(clientConfig.lock().get().servers()).containsExactly(LOCAL_SERVER_NAME);
}
Also used : ImmutableAtlasDbConfig(com.palantir.atlasdb.config.ImmutableAtlasDbConfig) AtlasDbConfig(com.palantir.atlasdb.config.AtlasDbConfig) Test(org.junit.Test)

Example 3 with AtlasDbConfig

use of com.palantir.atlasdb.config.AtlasDbConfig in project atlasdb by palantir.

the class AtlasDbCommandUtilsTest method timestampBlockExistsAfterConvertingConfig.

@Test
public void timestampBlockExistsAfterConvertingConfig() {
    AtlasDbConfig clientConfig = AtlasDbCommandUtils.convertServerConfigToClientConfig(minimalLeaderConfig, Optional.of(EMPTY_RUNTIME_CONFIG));
    assertThat(clientConfig.timestamp().isPresent()).isTrue();
}
Also used : ImmutableAtlasDbConfig(com.palantir.atlasdb.config.ImmutableAtlasDbConfig) AtlasDbConfig(com.palantir.atlasdb.config.AtlasDbConfig) Test(org.junit.Test)

Example 4 with AtlasDbConfig

use of com.palantir.atlasdb.config.AtlasDbConfig in project atlasdb by palantir.

the class AtlasDbCommandUtilsTest method leaderBlockNoLongerExistsAfterConvertingConfig.

@Test
public void leaderBlockNoLongerExistsAfterConvertingConfig() {
    AtlasDbConfig clientConfig = AtlasDbCommandUtils.convertServerConfigToClientConfig(minimalLeaderConfig, Optional.of(EMPTY_RUNTIME_CONFIG));
    assertThat(clientConfig.leader().isPresent()).isFalse();
}
Also used : ImmutableAtlasDbConfig(com.palantir.atlasdb.config.ImmutableAtlasDbConfig) AtlasDbConfig(com.palantir.atlasdb.config.AtlasDbConfig) Test(org.junit.Test)

Example 5 with AtlasDbConfig

use of com.palantir.atlasdb.config.AtlasDbConfig 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();
}
Also used : ImmutableServerListConfig(com.palantir.atlasdb.config.ImmutableServerListConfig) MetricRegistry(com.codahale.metrics.MetricRegistry) ImmutableTimeLockClientConfig(com.palantir.atlasdb.config.ImmutableTimeLockClientConfig) InMemoryAtlasDbConfig(com.palantir.atlasdb.memory.InMemoryAtlasDbConfig) DefaultTaggedMetricRegistry(com.palantir.tritium.metrics.registry.DefaultTaggedMetricRegistry) Collectors(java.util.stream.Collectors) TransactionManagers(com.palantir.atlasdb.factory.TransactionManagers) List(java.util.List) ImmutableAtlasDbConfig(com.palantir.atlasdb.config.ImmutableAtlasDbConfig) SslConfiguration(com.palantir.remoting.api.config.ssl.SslConfiguration) Paths(java.nio.file.Paths) SerializableTransactionManager(com.palantir.atlasdb.transaction.impl.SerializableTransactionManager) AtlasDbConfig(com.palantir.atlasdb.config.AtlasDbConfig) MetricRegistry(com.codahale.metrics.MetricRegistry) DefaultTaggedMetricRegistry(com.palantir.tritium.metrics.registry.DefaultTaggedMetricRegistry) InMemoryAtlasDbConfig(com.palantir.atlasdb.memory.InMemoryAtlasDbConfig) ImmutableAtlasDbConfig(com.palantir.atlasdb.config.ImmutableAtlasDbConfig) AtlasDbConfig(com.palantir.atlasdb.config.AtlasDbConfig) InMemoryAtlasDbConfig(com.palantir.atlasdb.memory.InMemoryAtlasDbConfig)

Aggregations

AtlasDbConfig (com.palantir.atlasdb.config.AtlasDbConfig)20 ImmutableAtlasDbConfig (com.palantir.atlasdb.config.ImmutableAtlasDbConfig)15 Test (org.junit.Test)12 InMemoryAtlasDbConfig (com.palantir.atlasdb.memory.InMemoryAtlasDbConfig)8 MetricRegistry (com.codahale.metrics.MetricRegistry)4 SerializableTransactionManager (com.palantir.atlasdb.transaction.impl.SerializableTransactionManager)4 DefaultTaggedMetricRegistry (com.palantir.tritium.metrics.registry.DefaultTaggedMetricRegistry)4 AtlasDbRuntimeConfig (com.palantir.atlasdb.config.AtlasDbRuntimeConfig)2 ImmutableServerListConfig (com.palantir.atlasdb.config.ImmutableServerListConfig)2 ImmutableTimeLockClientConfig (com.palantir.atlasdb.config.ImmutableTimeLockClientConfig)2 ServicesConfigModule (com.palantir.atlasdb.services.ServicesConfigModule)2 List (java.util.List)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)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