• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ArtifactStoreBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中de.flapdoodle.embed.mongo.config.ArtifactStoreBuilder的典型用法代码示例。如果您正苦于以下问题:Java ArtifactStoreBuilder类的具体用法?Java ArtifactStoreBuilder怎么用?Java ArtifactStoreBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ArtifactStoreBuilder类属于de.flapdoodle.embed.mongo.config包,在下文中一共展示了ArtifactStoreBuilder类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: runtimeConfig

import de.flapdoodle.embed.mongo.config.ArtifactStoreBuilder; //导入依赖的package包/类
private IRuntimeConfig runtimeConfig()
{
    FixedPath path = new FixedPath( "bin/" );
    IStreamProcessor mongodOutput;
    IStreamProcessor mongodError;
    IStreamProcessor commandsOutput;
    try
    {
        mongodOutput = Processors.named( "[mongod>]", new FileStreamProcessor( new File( logPath, "mongo.log" ) ) );

        mongodError = new FileStreamProcessor( new File( logPath, "mongo-err.log" ) );
        commandsOutput =
            Processors.named( "[mongod>]", new FileStreamProcessor( new File( logPath, "mongo.log" ) ) );
    }
    catch ( FileNotFoundException e )
    {
        throw Throwables.propagate( e );
    }
    return new RuntimeConfigBuilder().defaults( Command.MongoD )
        .processOutput( new ProcessOutput( mongodOutput, mongodError, commandsOutput ) )
        .artifactStore( new ArtifactStoreBuilder().downloader( new Downloader() )
            .executableNaming( new UserTempNaming() ).tempDir( path ).download(
                new DownloadConfigBuilder().defaultsForCommand( Command.MongoD ).artifactStorePath( path ) ) )
        .build();
}
 
开发者ID:cherimojava,项目名称:orchidae,代码行数:26,代码来源:cfgMongo.java


示例2: setup

import de.flapdoodle.embed.mongo.config.ArtifactStoreBuilder; //导入依赖的package包/类
@Before
public void setup() throws Exception {

     	IStreamProcessor stream = new NullProcessor();
     	MongodStarter runtime = MongodStarter.getInstance(new RuntimeConfigBuilder()
            .defaults(Command.MongoD)
            .processOutput(new ProcessOutput(stream, stream, stream))
            .artifactStore(new ArtifactStoreBuilder()
                .defaults(Command.MongoD)
                .build())
            .build());
     	this.mongodExecutable = runtime.prepare(new MongodConfigBuilder()
            .version(Version.Main.PRODUCTION)
            .net(new Net(PROCESS_PORT, Network.localhostIsIPv6()))
            .build());
         
     	this.mongodProcess = mongodExecutable.start();
     	this.mongoClient = new MongoClient(PROCESS_ADDRESS, PROCESS_PORT);
	
	Injector injector = Guice.createInjector(new SearchModule(), new HttpModule());
	this.groundHogDB = new GroundhogDB(this.mongoClient, "myGitHubResearch");
	this.searchGitHub = injector.getInstance(SearchGitHub.class);
	
}
 
开发者ID:spgroup,项目名称:groundhog,代码行数:25,代码来源:GroundhogDBTest.java


示例3: before

import de.flapdoodle.embed.mongo.config.ArtifactStoreBuilder; //导入依赖的package包/类
@Override
public void before() throws Throwable {

    int port = Network.getFreeServerPort();
    String portProp = System.getProperty(MONGO_PORT_PROP);
    if (portProp != null && !portProp.isEmpty()) {
        port = Integer.valueOf(portProp);
    }

    IMongodConfig conf =
            new MongodConfigBuilder().version(Version.Main.PRODUCTION)
                .net(new Net(port, Network.localhostIsIPv6())).build();

    Command command = Command.MongoD;
    IRuntimeConfig runtimeConfig =
            new RuntimeConfigBuilder()
                .defaultsWithLogger(command, LOGGER)
                .artifactStore(
                        new ArtifactStoreBuilder().defaults(command).download(
                                new DownloadConfigBuilder().defaultsForCommand(command).proxyFactory(new SystemProxy())))
                .build();

    MongodStarter runtime = MongodStarter.getInstance(runtimeConfig);
    mongoExec = runtime.prepare(conf);

    mongoProc = mongoExec.start();

    client = new MongoClient(new ServerAddress(conf.net().getServerAddress(), conf.net().getPort()));

    // set the property for our config...
    System.setProperty("dbhost", conf.net().getServerAddress().getHostAddress());
    System.setProperty("dbport", Integer.toString(conf.net().getPort()));
}
 
开发者ID:jimzucker,项目名称:hygieia-temp,代码行数:34,代码来源:EmbeddedMongoDBRule.java


示例4: runtimeConfig

import de.flapdoodle.embed.mongo.config.ArtifactStoreBuilder; //导入依赖的package包/类
private static IRuntimeConfig runtimeConfig()
{
    FixedPath path = new FixedPath( "bin/" );
    return new RuntimeConfigBuilder().defaults( Command.MongoD )
        .artifactStore( new ArtifactStoreBuilder().downloader( new Downloader() )
            .executableNaming( new UserTempNaming() ).tempDir( path ).download(
                new DownloadConfigBuilder().defaultsForCommand( Command.MongoD ).artifactStorePath( path ) ) )
        .build();
}
 
开发者ID:cherimojava,项目名称:cherimodata,代码行数:10,代码来源:Suite.java


示例5: setup_mongo

import de.flapdoodle.embed.mongo.config.ArtifactStoreBuilder; //导入依赖的package包/类
@BeforeClass
public static void setup_mongo() throws UnknownHostException, IOException{
	
	String proxyHost = System.getenv("http.proxyHost");
	String proxyPort = System.getenv("http.proxyPort");
	
	String proxy = System.getenv("http_proxy");
	System.out.println("Proxy URL : " + proxy);
	if(proxy != null){
		if(proxyHost == null && proxyPort == null){
			URL proxyurl = new URL(proxy);
		   proxyHost = proxyurl.getHost();
		   proxyPort = String.valueOf(proxyurl.getPort());
		}  
	}
	
	MongodStarter starter ;
	
	System.out.println("Proxy Host : " + proxyHost);
	System.out.println("Proxy Port : " + proxyPort);
	if (proxyHost != null && proxyPort != null) {
		IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder().defaults(Command.MongoD)
				.artifactStore(
						new ArtifactStoreBuilder().defaults(Command.MongoD)
								.download(
										new DownloadConfigBuilder()
												.defaultsForCommand(Command.MongoD)
												.proxyFactory(
														new HttpProxyFactory(
																proxyHost,
																Integer.parseInt(proxyPort)))
												.build()).build()).build();
		 starter = MongodStarter.getInstance(runtimeConfig);
	} else {
		 starter = MongodStarter.getDefaultInstance();
	}
		                                        		
	
	IMongodConfig mongodConfig = new MongodConfigBuilder()
			.version(Version.Main.PRODUCTION)
			.net(new Net(mongoport, Network.localhostIsIPv6())).build();

	MongodExecutable mongodExecutable = null;

	mongodExecutable = starter.prepare(mongodConfig);
	mongod = mongodExecutable.start();
	
}
 
开发者ID:pulsarIO,项目名称:jetstream,代码行数:49,代码来源:DynamicConfigTest.java


示例6: init

import de.flapdoodle.embed.mongo.config.ArtifactStoreBuilder; //导入依赖的package包/类
@BeforeSuite
public static void init() throws IOException {
    Command command = Command.MongoD;

    try {
        Files.forceDelete(new File(DB_FOLDER_NAME));
    } catch (Exception e) {

    }

    new File(DB_FOLDER_NAME).mkdirs();

    IMongodConfig mongodConfig = new MongodConfigBuilder()
            .version(Version.Main.PRODUCTION)
            .configServer(false)
            .replication(new Storage(DB_FOLDER_NAME, null, 0))
            .net(new Net(PORT, Network.localhostIsIPv6()))
            .cmdOptions(new MongoCmdOptionsBuilder()
                    .syncDelay(10)
                    .useNoPrealloc(true)
                    .useSmallFiles(true)
                    .useNoJournal(true)
                    .build())
            .build();

    IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder()
            .defaults(command)
            .artifactStore(new ArtifactStoreBuilder()
                    .defaults(command)
                    .download(new DownloadConfigBuilder()
                            .defaultsForCommand(command)
                            .downloadPath("https://s3-eu-west-1.amazonaws.com/stratio-mongodb-distribution/")))
            .build();

    MongodStarter runtime = MongodStarter.getInstance(runtimeConfig);

    mongodExecutable = null;

    mongodExecutable = runtime.prepare(mongodConfig);

    mongod = mongodExecutable.start();

}
 
开发者ID:Stratio,项目名称:deep-spark,代码行数:44,代码来源:MongoJavaRDDFT.java



注:本文中的de.flapdoodle.embed.mongo.config.ArtifactStoreBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ScanResponse类代码示例发布时间:2022-05-23
下一篇:
Java Opcodes类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap