private void initializeMongos() throws Exception { MongosStarter runtime = MongosStarter.getInstance(new RuntimeConfigBuilder() .defaultsWithLogger(Command.MongoS,logger) .processOutput(outputFunction.apply(Command.MongoS)) .build()); mongosExecutable = runtime.prepare(config); mongosProcess = mongosExecutable.start(); }
"Replica set name must match in mongo configuration"); IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder() .defaultsWithLogger(Command.MongoD,logger) .processOutput(outputFunction.apply(Command.MongoD))
public static MongodStarter getDefaultInstance() { return getInstance(new RuntimeConfigBuilder().defaults(Command.MongoD).build()); }
public static MongosStarter getDefaultInstance() { return getInstance(new RuntimeConfigBuilder().defaults(Command.MongoS).build()); }
public static MongoImportStarter getDefaultInstance() { return getInstance(new RuntimeConfigBuilder() .defaults(Command.MongoImport) .daemonProcess(false) .build()); }
public static MongoShellStarter getDefaultInstance() { return getInstance(new RuntimeConfigBuilder() .defaults(Command.Mongo) .daemonProcess(false) .build()); }
public static MongoRestoreStarter getDefaultInstance() { return getInstance(new RuntimeConfigBuilder() .defaults(Command.MongoRestore) .daemonProcess(false) .build()); }
public static MongoDumpStarter getDefaultInstance() { return getInstance(new RuntimeConfigBuilder().defaults(Command.MongoDump) .daemonProcess(false) .build()); }
private void initializeMongos() throws Exception { MongosStarter runtime = MongosStarter.getInstance(new RuntimeConfigBuilder() .defaultsWithLogger(Command.MongoS,logger) .build()); mongosExecutable = runtime.prepare(config); mongosProcess = mongosExecutable.start(); }
private IRuntimeConfig buildRuntimeConfig() { return new RuntimeConfigBuilder() .defaults(Command.MongoD) .processOutput(buildOutputConfig()) .artifactStore(buildArtifactStore()) .build(); }
/** * Create the testing utility using the specified version of MongoDB. * * @param version * version of MongoDB. */ public MongodForTestsFactory(final IFeatureAwareVersion version) throws IOException { final MongodStarter runtime = MongodStarter.getInstance(new RuntimeConfigBuilder() .defaultsWithLogger(Command.MongoD, logger) .build()); mongodExecutable = runtime.prepare(newMongodConfig(version)); mongodProcess = mongodExecutable.start(); }
/** * Create the testing utility using the specified version of MongoDB. * * @param version * version of MongoDB. */ private EmbeddedMongoFactory(final IFeatureAwareVersion version) throws IOException { final MongodStarter runtime = MongodStarter.getInstance(new RuntimeConfigBuilder().defaultsWithLogger(Command.MongoD, logger).build()); mongodExecutable = runtime.prepare(newMongodConfig(version)); mongodProcess = mongodExecutable.start(); }
/** * Create the testing utility using the specified version of MongoDB. * * @param version * version of MongoDB. */ private EmbeddedMongoFactory(final IFeatureAwareVersion version) throws IOException { final MongodStarter runtime = MongodStarter.getInstance(new RuntimeConfigBuilder().defaultsWithLogger(Command.MongoD, logger).build()); mongodExecutable = runtime.prepare(newMongodConfig(version)); mongodProcess = mongodExecutable.start(); }
Collections.<String>emptySet(), namedConsole("[mongod output]")); runtimeConfig = new RuntimeConfigBuilder() .defaults(Command.MongoD) .processOutput(new ProcessOutput(
Collections.<String>emptySet(), namedConsole("[mongod output]")); runtimeConfig = new RuntimeConfigBuilder() .defaults(Command.MongoD) .processOutput(new ProcessOutput(
public static void startMongoDB() throws IOException { if (!started.compareAndSet(false, true)) { throw new RuntimeException("Embedded mongo already running, call stopMongoDB before starting it again!"); } final String bindIp = "localhost"; try { final int port = Network.getFreeServerPort(); final IMongodConfig mongodConfig = new MongodConfigBuilder() .version(Version.Main.PRODUCTION) .net(new Net(bindIp, port, Network.localhostIsIPv6())) .build(); final MongodStarter runtime = MongodStarter.getInstance(new RuntimeConfigBuilder() .defaultsWithLogger(Command.MongoD, LOG) .build()); mongodExecutable = runtime.prepare(mongodConfig, Distribution.detectFor(Version.Main.PRODUCTION)); mongodProcess = mongodExecutable.start(); mongoClient = new MongoClient(bindIp, port); } catch (final IOException e) { stopMongoDB(); throw e; } }
mongoOutput = new NamedOutputStreamProcessor("[mongo shell output]", console()); IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder() .defaults(Command.Mongo) .processOutput(new ProcessOutput(
final MongosStarter mongoConfigRuntime = MongosStarter.getInstance(new RuntimeConfigBuilder() .defaultsWithLogger(Command.MongoS,logger) .build()); mongoConfigProcess = mongoConfigExecutable.start(); final MongosStarter runtime = MongosStarter.getInstance(new RuntimeConfigBuilder() .defaultsWithLogger(Command.MongoS, logger) .build());
); final IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder() .defaults(Command.MongoD) .processOutput(processOutput)
private static MongodExecutable configureMongoDb(final String bindIp, final int mongoDbPort, final IProxyFactory proxyFactory) throws IOException { final Command command = Command.MongoD; final MongodStarter mongodStarter = MongodStarter.getInstance(new RuntimeConfigBuilder() .defaults(command) .processOutput(ProcessOutput.getDefaultInstanceSilent()) .artifactStore(new ArtifactStoreBuilder() .defaults(command) .download(new DownloadConfigBuilder() .defaultsForCommand(command) .proxyFactory(proxyFactory) .progressListener(new StandardConsoleProgressListener()) ) ) .build()); return mongodStarter.prepare(new MongodConfigBuilder() .net(new Net(bindIp, mongoDbPort, false)) .version(Version.Main.PRODUCTION) .cmdOptions(new MongoCmdOptionsBuilder() .useStorageEngine("wiredTiger") .useNoJournal(false) .build()) .build()); }