use of com.torodb.mongodb.repl.ConsistencyHandler in project torodb by torodb.
the class StampedeService method startUp.
@Override
protected void startUp() throws Exception {
LOGGER.info("Starting up ToroDB Stampede");
shutdowner = bootstrapInjector.getInstance(Shutdowner.class);
shutdowner.awaitRunning();
BackendBundle backendBundle = createBackendBundle();
startBundle(backendBundle);
BackendService backendService = backendBundle.getBackendService();
ConsistencyHandler consistencyHandler = createConsistencyHandler(backendService);
if (!consistencyHandler.isConsistent()) {
LOGGER.info("Database is not consistent. Cleaning it up");
dropDatabase(backendService);
}
Injector finalInjector = createFinalInjector(backendBundle, consistencyHandler);
AbstractReplication replication = getReplication();
reportReplication(replication);
TorodBundle torodBundle = createTorodBundle(finalInjector);
startBundle(torodBundle);
MongodbReplConfig replConfig = getReplConfig(replication);
startBundle(createMongodbReplBundle(finalInjector, torodBundle, replConfig));
LOGGER.info("ToroDB Stampede is now running");
}
use of com.torodb.mongodb.repl.ConsistencyHandler in project torodb by torodb.
the class StampedeRuntimeModule method configure.
@Override
protected void configure() {
binder().requireExplicitBindings();
bind(ConsistencyHandler.class).toInstance(consistencyHandler);
expose(ConsistencyHandler.class);
bind(BackendService.class).toInstance(backend.getBackendService());
expose(BackendService.class);
install(new D2RModule());
install(new SqlTorodModule());
}
Aggregations