use of com.palantir.atlasdb.services.ServicesConfigModule in project atlasdb by palantir.
the class KvsMigrationCommand method connectToServices.
public AtlasDbServices connectToServices() throws IOException {
AtlasDbConfig toConfig = toConfigFile != null ? AtlasDbConfigs.load(toConfigFile, configRoot, AtlasDbConfig.class) : AtlasDbConfigs.loadFromString(inlineConfig, null, AtlasDbConfig.class);
ServicesConfigModule scm = ServicesConfigModule.create(makeOfflineIfNecessary(toConfig), AtlasDbRuntimeConfig.withSweepDisabled());
return DaggerAtlasDbServices.builder().servicesConfigModule(scm).build();
}
use of com.palantir.atlasdb.services.ServicesConfigModule in project atlasdb by palantir.
the class KvsMigrationCommand method connectFromServices.
public AtlasDbServices connectFromServices() throws IOException {
AtlasDbConfig fromConfig = AtlasDbConfigs.load(fromConfigFile, configRoot, AtlasDbConfig.class);
ServicesConfigModule scm = ServicesConfigModule.create(makeOfflineIfNecessary(fromConfig), AtlasDbRuntimeConfig.withSweepDisabled());
return DaggerAtlasDbServices.builder().servicesConfigModule(scm).build();
}
use of com.palantir.atlasdb.services.ServicesConfigModule 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;
}
use of com.palantir.atlasdb.services.ServicesConfigModule in project atlasdb by palantir.
the class TestSweepCommand method setup.
@BeforeClass
public static void setup() throws Exception {
sweepTimestamp = new AtomicLong();
moduleFactory = new AtlasDbServicesFactory() {
@Override
public TestAtlasDbServices connect(ServicesConfigModule servicesConfigModule) {
return DaggerTestAtlasDbServices.builder().servicesConfigModule(servicesConfigModule).testSweeperModule(TestSweeperModule.create(sweepTimestamp::get)).build();
}
};
}
use of com.palantir.atlasdb.services.ServicesConfigModule in project atlasdb by palantir.
the class TestTimestampCommand method oneTimeSetup.
@BeforeClass
public static void oneTimeSetup() throws Exception {
lock = StringLockDescriptor.of("lock");
moduleFactory = new AtlasDbServicesFactory() {
@Override
public TestAtlasDbServices connect(ServicesConfigModule servicesConfigModule) {
return DaggerTestAtlasDbServices.builder().servicesConfigModule(servicesConfigModule).build();
}
};
}
Aggregations