Search in sources :

Example 1 with ImmutableAtlasDbRuntimeConfig

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

the class AtlasDbServicesConnector method connect.

public AtlasDbServices connect() {
    if (services != null) {
        throw new IllegalStateException("connect() has already been called");
    }
    DockerizedDatabaseUri dburi = DockerizedDatabaseUri.fromUriString(uri);
    KeyValueServiceConfig config = dburi.getKeyValueServiceInstrumentation().getKeyValueServiceConfig(dburi.getAddress());
    ImmutableAtlasDbConfig atlasDbConfig = ImmutableAtlasDbConfig.builder().keyValueService(config).build();
    ImmutableAtlasDbRuntimeConfig runtimeConfig = ImmutableAtlasDbRuntimeConfig.defaultRuntimeConfig();
    ServicesConfigModule servicesConfigModule = ServicesConfigModule.create(atlasDbConfig, runtimeConfig);
    services = DaggerAtlasDbServices.builder().servicesConfigModule(servicesConfigModule).build();
    return services;
}
Also used : KeyValueServiceConfig(com.palantir.atlasdb.spi.KeyValueServiceConfig) ImmutableAtlasDbRuntimeConfig(com.palantir.atlasdb.config.ImmutableAtlasDbRuntimeConfig) ImmutableAtlasDbConfig(com.palantir.atlasdb.config.ImmutableAtlasDbConfig) ServicesConfigModule(com.palantir.atlasdb.services.ServicesConfigModule)

Aggregations

ImmutableAtlasDbConfig (com.palantir.atlasdb.config.ImmutableAtlasDbConfig)1 ImmutableAtlasDbRuntimeConfig (com.palantir.atlasdb.config.ImmutableAtlasDbRuntimeConfig)1 ServicesConfigModule (com.palantir.atlasdb.services.ServicesConfigModule)1 KeyValueServiceConfig (com.palantir.atlasdb.spi.KeyValueServiceConfig)1