use of com.torodb.mongodb.repl.OplogManager in project torodb by torodb.
the class OplogTestContextResourceRule method before.
@Override
protected void before() throws Throwable {
testInjector = Guice.createInjector(new ReplTestModule(), new TorodServerTestModule(), new CoreModule(), new BackendModule(), new DerbyBackendModule(), new MetainfModule(), new D2RModule(), new MemoryTorodModule(), new MetricsModule(new MetricsConfig() {
@Override
public Boolean getMetricsEnabled() {
return true;
}
}), new ConcurrentModule(), new MongoLayerModule(), new MongodServerTestModule(), specificModuleSupplier.get());
torodServer = testInjector.getInstance(TorodBundle.class).getTorodServer();
torodServer.startAsync();
mongodServer = testInjector.getInstance(MongodServer.class);
mongodServer.startAsync();
mongodServer.awaitRunning();
assert mongodServer.getTorodServer().equals(torodServer);
torodServer.awaitRunning();
oplogManager = testInjector.getInstance(OplogManager.class);
oplogManager.startAsync();
oplogManager.awaitRunning();
aobe = testInjector.getInstance(AnalyzedOplogBatchExecutor.class);
aobe.startAsync();
aobe.awaitRunning();
oplogApplier = testInjector.getInstance(OplogApplier.class);
testContext = new DefaultOplogTestContext(mongodServer, oplogApplier);
}
use of com.torodb.mongodb.repl.OplogManager in project torodb by torodb.
the class SequentialOplogApplierService method startUp.
@Override
protected void startUp() {
callback.waitUntilStartPermision();
LOGGER.info("Starting SECONDARY service");
paused = false;
fetcherIsPaused = false;
pauseRequested = false;
long lastAppliedHash;
OpTime lastAppliedOptime;
try (OplogManager.ReadOplogTransaction oplogReadTrans = oplogManager.createReadTransaction()) {
lastAppliedHash = oplogReadTrans.getLastAppliedHash();
lastAppliedOptime = oplogReadTrans.getLastAppliedOptime();
}
fetcherService = new ReplSyncFetcher(threadFactory, new FetcherView(), oplogFetcherFactory.createFetcher(lastAppliedHash, lastAppliedOptime));
fetcherService.startAsync();
applierService = new ReplSyncApplier(threadFactory, oplogOpApplier, server, oplogManager, new ApplierView());
applierService.startAsync();
fetcherService.awaitRunning();
applierService.awaitRunning();
LOGGER.info("Started SECONDARY service");
}
Aggregations