Search in sources :

Example 1 with TimeLockServerConfiguration

use of com.palantir.atlasdb.timelock.config.TimeLockServerConfiguration in project atlasdb by palantir.

the class BlockingTimeoutsTest method returnsDefaultBlockingTimeoutWithNoSpecifiedConnectors.

@Test
public void returnsDefaultBlockingTimeoutWithNoSpecifiedConnectors() {
    TimeLockServerConfiguration basicConfiguration = new TimeLockServerConfiguration(null, CLUSTER, CLIENTS, null, ImmutableTimeLimiterConfiguration.of(true, TEST_ERROR_MARGIN), null, null);
    long expectedMargin = scaleForErrorMarginReferenceImplementation(BlockingTimeouts.DEFAULT_IDLE_TIMEOUT, TEST_ERROR_MARGIN);
    assertThat(BlockingTimeouts.getBlockingTimeout(OBJECT_MAPPER, basicConfiguration)).isEqualTo(expectedMargin);
}
Also used : TimeLockServerConfiguration(com.palantir.atlasdb.timelock.config.TimeLockServerConfiguration) Test(org.junit.Test)

Example 2 with TimeLockServerConfiguration

use of com.palantir.atlasdb.timelock.config.TimeLockServerConfiguration in project atlasdb by palantir.

the class TimeLockServerLauncher method run.

@Override
public void run(TimeLockServerConfiguration configuration, Environment environment) {
    environment.getObjectMapper().registerModule(new Jdk8Module());
    environment.jersey().register(HttpRemotingJerseyFeature.INSTANCE);
    CombinedTimeLockServerConfiguration combined = TimeLockConfigMigrator.convert(configuration, environment);
    Consumer<Object> registrar = component -> environment.jersey().register(component);
    TimeLockAgent.create(combined.install(), // this won't actually live reload
    combined::runtime, combined.deprecated(), registrar);
}
Also used : Environment(io.dropwizard.setup.Environment) Application(io.dropwizard.Application) MetricRegistry(com.codahale.metrics.MetricRegistry) Bootstrap(io.dropwizard.setup.Bootstrap) AtlasDbMetrics(com.palantir.atlasdb.util.AtlasDbMetrics) SharedMetricRegistries(com.codahale.metrics.SharedMetricRegistries) UUID(java.util.UUID) TimeLockAgent(com.palantir.timelock.paxos.TimeLockAgent) DefaultTaggedMetricRegistry(com.palantir.tritium.metrics.registry.DefaultTaggedMetricRegistry) TaggedMetricRegistry(com.palantir.tritium.metrics.registry.TaggedMetricRegistry) Jdk8Module(com.fasterxml.jackson.datatype.jdk8.Jdk8Module) Consumer(java.util.function.Consumer) TimeLockServerConfiguration(com.palantir.atlasdb.timelock.config.TimeLockServerConfiguration) CombinedTimeLockServerConfiguration(com.palantir.atlasdb.timelock.config.CombinedTimeLockServerConfiguration) NonBlockingFileAppenderFactory(com.palantir.atlasdb.timelock.logging.NonBlockingFileAppenderFactory) HttpRemotingJerseyFeature(com.palantir.remoting3.servers.jersey.HttpRemotingJerseyFeature) TimeLockConfigMigrator(com.palantir.atlasdb.timelock.config.TimeLockConfigMigrator) Jdk8Module(com.fasterxml.jackson.datatype.jdk8.Jdk8Module) CombinedTimeLockServerConfiguration(com.palantir.atlasdb.timelock.config.CombinedTimeLockServerConfiguration)

Aggregations

TimeLockServerConfiguration (com.palantir.atlasdb.timelock.config.TimeLockServerConfiguration)2 MetricRegistry (com.codahale.metrics.MetricRegistry)1 SharedMetricRegistries (com.codahale.metrics.SharedMetricRegistries)1 Jdk8Module (com.fasterxml.jackson.datatype.jdk8.Jdk8Module)1 CombinedTimeLockServerConfiguration (com.palantir.atlasdb.timelock.config.CombinedTimeLockServerConfiguration)1 TimeLockConfigMigrator (com.palantir.atlasdb.timelock.config.TimeLockConfigMigrator)1 NonBlockingFileAppenderFactory (com.palantir.atlasdb.timelock.logging.NonBlockingFileAppenderFactory)1 AtlasDbMetrics (com.palantir.atlasdb.util.AtlasDbMetrics)1 HttpRemotingJerseyFeature (com.palantir.remoting3.servers.jersey.HttpRemotingJerseyFeature)1 TimeLockAgent (com.palantir.timelock.paxos.TimeLockAgent)1 DefaultTaggedMetricRegistry (com.palantir.tritium.metrics.registry.DefaultTaggedMetricRegistry)1 TaggedMetricRegistry (com.palantir.tritium.metrics.registry.TaggedMetricRegistry)1 Application (io.dropwizard.Application)1 Bootstrap (io.dropwizard.setup.Bootstrap)1 Environment (io.dropwizard.setup.Environment)1 UUID (java.util.UUID)1 Consumer (java.util.function.Consumer)1 Test (org.junit.Test)1