Search in sources :

Example 1 with ServerListConfig

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

the class TimeLockMigratorTest method setUp.

@Before
public void setUp() {
    when(invalidator.backupAndInvalidate()).thenReturn(BACKUP_TIMESTAMP);
    wireMockRule.stubFor(PING_MAPPING.willReturn(aResponse().withStatus(200).withBody(TimestampManagementService.PING_RESPONSE).withHeader("Content-Type", "text/plain")).inScenario(SCENARIO).whenScenarioStateIs(Scenario.STARTED).willSetStateTo(Scenario.STARTED));
    String serverUri = String.format("http://%s:%s", WireMockConfiguration.DEFAULT_BIND_ADDRESS, wireMockRule.port());
    ServerListConfig defaultServerListConfig = ImmutableServerListConfig.builder().addServers(serverUri).build();
    timelockConfig = ImmutableTimeLockClientConfig.builder().client("testClient").serversList(defaultServerListConfig).build();
}
Also used : ImmutableServerListConfig(com.palantir.atlasdb.config.ImmutableServerListConfig) ServerListConfig(com.palantir.atlasdb.config.ServerListConfig) Before(org.junit.Before)

Example 2 with ServerListConfig

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

the class TransactionManagers method createRawServicesFromTimeLock.

private static LockAndTimestampServices createRawServicesFromTimeLock(AtlasDbConfig config, Supplier<AtlasDbRuntimeConfig> runtimeConfigSupplier, TimestampStoreInvalidator invalidator, String userAgent) {
    Supplier<ServerListConfig> serverListConfigSupplier = getServerListConfigSupplierForTimeLock(config, runtimeConfigSupplier);
    TimeLockMigrator migrator = TimeLockMigrator.create(serverListConfigSupplier, invalidator, userAgent, config.initializeAsync());
    // This can proceed async if config.initializeAsync() was set
    migrator.migrate();
    return ImmutableLockAndTimestampServices.copyOf(getLockAndTimestampServices(serverListConfigSupplier, userAgent)).withMigrator(migrator);
}
Also used : ImmutableServerListConfig(com.palantir.atlasdb.config.ImmutableServerListConfig) ServerListConfig(com.palantir.atlasdb.config.ServerListConfig) TimeLockMigrator(com.palantir.atlasdb.factory.startup.TimeLockMigrator)

Aggregations

ImmutableServerListConfig (com.palantir.atlasdb.config.ImmutableServerListConfig)2 ServerListConfig (com.palantir.atlasdb.config.ServerListConfig)2 TimeLockMigrator (com.palantir.atlasdb.factory.startup.TimeLockMigrator)1 Before (org.junit.Before)1