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