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);
}
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);
}
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();
}
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();
}
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();
}
Aggregations