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

Java ElasticsearchClusterRunner类代码示例

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

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



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

示例1: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
public void setUp(final BiConsumer<Integer, Builder> consumer) throws Exception {
    clusterName = "es-idxproxy-" + System.currentTimeMillis();
    // create runner instance
    runner = new ElasticsearchClusterRunner();
    // create ES nodes
    runner.onBuild((number, settingsBuilder) -> {
        settingsBuilder.put("http.cors.enabled", true);
        settingsBuilder.put("http.cors.allow-origin", "*");
        settingsBuilder.putArray("discovery.zen.ping.unicast.hosts", "127.0.0.1:9301-9310");
        consumer.accept(number, settingsBuilder);
    }).build(newConfigs().clusterName(clusterName).numOfNode(numOfNode)
            .pluginTypes("org.codelibs.elasticsearch.idxproxy.IndexingProxyPlugin"));

    // wait for yellow status
    runner.ensureYellow();
}
 
开发者ID:codelibs,项目名称:elasticsearch-indexing-proxy,代码行数:17,代码来源:IndexingProxyPluginTest.java


示例2: cleanUpOnce

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@BeforeClass
public static void cleanUpOnce() throws Exception {
    deleteDirectory("target/testcluster/");
    clusterName = "es-cl-run-" + System.currentTimeMillis();
    // create runner instance
    runner = new ElasticsearchClusterRunner();
    // create ES nodes
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
        }
    }).build(
            newConfigs()
            .clusterName("testCluster")
            .numOfNode(3)
            .basePath("target/testcluster/")
            .useLogger());

    // wait for green status
    runner.ensureGreen();
    
    client = runner.client();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:26,代码来源:ElasticsearchClusterBaseTest.java


示例3: before

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Override
protected void before() throws Throwable {
    File tempDir = new File(System.getProperty("java.io.tmpdir"));
    File basePath = new File(tempDir, "vertexium-test-" + UUID.randomUUID().toString());
    LOGGER.info("base path: %s", basePath);

    File vertexiumPluginDir = new File(basePath, "plugins/vertexium");
    vertexiumPluginDir.mkdirs();
    expandVertexiumPlugin(vertexiumPluginDir);

    LogConfigurator.registerErrorListener();

    runner = new ElasticsearchClusterRunner();
    runner.onBuild((i, builder) ->
                           builder.put("script.inline", "true")
                                   .put("cluster.name", clusterName)
                                    .put("http.type", "netty3")
                                    .put("transport.type", "netty3")
    ).build(newConfigs().basePath(basePath.getAbsolutePath()).numOfNode(1));

    runner.ensureGreen();
}
 
开发者ID:visallo,项目名称:vertexium,代码行数:23,代码来源:ElasticsearchResource.java


示例4: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    clusterName = "es-analyzeapi-" + System.currentTimeMillis();
    // create runner instance
    runner = new ElasticsearchClusterRunner();
    // create ES nodes
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.putArray("discovery.zen.ping.unicast.hosts", "localhost:9301-9310");
        }
    }).build(newConfigs().clusterName(clusterName).numOfNode(numOfNode)
            .pluginTypes("org.codelibs.elasticsearch.analyze.AnalyzeApiPlugin,org.codelibs.elasticsearch.ja.JaPlugin"));

    // wait for yellow status
    runner.ensureYellow();
}
 
开发者ID:codelibs,项目名称:elasticsearch-analyze-api,代码行数:20,代码来源:AnalyzeApiPluginTest.java


示例5: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    clusterName = "es-analysisja-" + System.currentTimeMillis();
    runner = new ElasticsearchClusterRunner();
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.putList("discovery.zen.ping.unicast.hosts", "localhost:9301-9310");
        }
    }).build(newConfigs().clusterName(clusterName).numOfNode(numOfNode)
            .pluginTypes("org.codelibs.elasticsearch.ja.JaPlugin,"
                    + "org.codelibs.elasticsearch.ja.kuromoji.plugin.analysis.kuromoji.AnalysisKuromojiPlugin"));

    userDictFiles = null;
}
 
开发者ID:codelibs,项目名称:elasticsearch-analysis-ja,代码行数:18,代码来源:JaPluginTest.java


示例6: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    clusterName = "es-langfield-" + System.currentTimeMillis();
    // create runner instance
    runner = new ElasticsearchClusterRunner();
    // create ES nodes
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.putList("discovery.zen.ping.unicast.hosts",
                    "localhost:9301-9310");
        }
    }).build(newConfigs().clusterName(clusterName).numOfNode(1).pluginTypes("org.codelibs.elasticsearch.langfield.LangFieldPlugin"));

    // wait for yellow status
    runner.ensureYellow();
}
 
开发者ID:codelibs,项目名称:elasticsearch-langfield,代码行数:20,代码来源:LangFieldPluginTest.java


示例7: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    clusterName = "es-kuromojineologd-" + System.currentTimeMillis();
    runner = new ElasticsearchClusterRunner();
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.putList("discovery.zen.ping.unicast.hosts", "localhost:9301-9310");
        }
    }).build(newConfigs().clusterName(clusterName).numOfNode(numOfNode)
            .pluginTypes("org.codelibs.elasticsearch.kuromoji.neologd.KuromojiNeologdPlugin"));

    userDictFiles = null;
}
 
开发者ID:codelibs,项目名称:elasticsearch-analysis-kuromoji-neologd,代码行数:17,代码来源:KuromojiNeologdPluginTest.java


示例8: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    // create runner instance
    runner = new ElasticsearchClusterRunner();
    // create ES nodes
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
        }
    }).build(
            newConfigs().ramIndexStore().numOfNode(1)
                    .clusterName(UUID.randomUUID().toString()));

    // wait for yellow status
    runner.ensureYellow();
}
 
开发者ID:sherlok,项目名称:sherlastic,代码行数:17,代码来源:SherlokPluginTest.java


示例9: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    clusterName = "es-dynarank-" + System.currentTimeMillis();
    runner = new ElasticsearchClusterRunner();
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("dynarank.cache.clean_interval", "1s");
            settingsBuilder.put("script.search", true);
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.putArray("discovery.zen.ping.unicast.hosts", "localhost:9301-9310");
        }
    }).build(newConfigs().numOfNode(1).clusterName(clusterName).pluginTypes(
            "org.codelibs.elasticsearch.dynarank.DynamicRankingPlugin" + ",org.codelibs.elasticsearch.minhash.MinHashPlugin"));
    runner.ensureGreen();
}
 
开发者ID:codelibs,项目名称:elasticsearch-dynarank,代码行数:18,代码来源:DynamicRankingPluginTest.java


示例10: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    clusterName = "es-reindexing-" + System.currentTimeMillis();
    // create runner instance
    runner = new ElasticsearchClusterRunner();
    // create ES nodes
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.put("index.number_of_shards", 3);
            settingsBuilder.put("index.number_of_replicas", 0);
            settingsBuilder.putArray("discovery.zen.ping.unicast.hosts",
                    "localhost:9301-9310");
            settingsBuilder.put("plugin.types",
                    "org.codelibs.elasticsearch.reindex.ReindexingPlugin");
            settingsBuilder
                    .put("index.unassigned.node_left.delayed_timeout", "0");
        }
    }).build(newConfigs().numOfNode(1).clusterName(clusterName));

    // wait for yellow status
    runner.ensureYellow();
}
 
开发者ID:codelibs,项目名称:elasticsearch-reindexing,代码行数:26,代码来源:ReindexingPluginTest.java


示例11: create_index

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
private void create_index(ElasticsearchClusterRunner runner, String index, String type, int number) {

        if (runner.indexExists(index))
            runner.deleteIndex(index);

        runner.createIndex(index, (Settings) null);

        if (!runner.indexExists(index))
            fail();

        for (int i = 0; i < number; i++) {
            final IndexResponse response = runner.insert(index, type, String.valueOf(i),
                    "{\"msg\":\"test " + i + "\", \"id\":\"" + i + "\"}");
            assertTrue(response.isCreated());
        }

        // make it searchable immediately
        runner.refresh();

        // search documents
        final SearchResponse searchResponse = runner.search(index, type, null, null, 0, 10);
        assertEquals(number, searchResponse.getHits().getTotalHits());

        assertTrue(runner.indexExists(index));
    }
 
开发者ID:codelibs,项目名称:elasticsearch-reindexing,代码行数:26,代码来源:ReindexingPluginTest.java


示例12: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    clusterName = "es-minhash-" + System.currentTimeMillis();
    // create runner instance
    runner = new ElasticsearchClusterRunner();
    // create ES nodes
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.putList("discovery.zen.ping.unicast.hosts", "localhost:9301-9310");
        }
    }).build(newConfigs().clusterName(clusterName).numOfNode(1).pluginTypes("org.codelibs.elasticsearch.minhash.MinHashPlugin"));

    // wait for yellow status
    runner.ensureYellow();
}
 
开发者ID:codelibs,项目名称:elasticsearch-minhash,代码行数:19,代码来源:MinHashPluginTest.java


示例13: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    clusterName = "es-taste-" + System.currentTimeMillis();
    // create runner instance
    runner = new ElasticsearchClusterRunner();
    // create ES nodes
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.putArray("discovery.zen.ping.unicast.hosts", "localhost:9301-9305");
            settingsBuilder.put("plugin.types", "org.codelibs.elasticsearch.taste.TastePlugin");
        }
    }).build(newConfigs().clusterName(clusterName).numOfNode(1));

    // wait for yellow status
    runner.ensureYellow();
}
 
开发者ID:codelibs,项目名称:elasticsearch-taste,代码行数:20,代码来源:TastePluginTest.java


示例14: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@BeforeClass
public static void setUp() throws IOException {
    clusterName = "es-dataformat-" + System.currentTimeMillis();
    // create runner instance
    runner = new ElasticsearchClusterRunner();
    // create ES nodes
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.putList("discovery.zen.ping.unicast.hosts", "localhost:9301-9310");
        }
    }).build(newConfigs().clusterName(clusterName).numOfNode(1)
            .pluginTypes("org.codelibs.elasticsearch.df.DataFormatPlugin"));

    // wait for yellow status
    runner.ensureYellow();

    indexing();

    node = runner.node();
}
 
开发者ID:codelibs,项目名称:elasticsearch-dataformat,代码行数:24,代码来源:DataFormatPluginTest.java


示例15: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    // create ES instance
    runner = new ElasticsearchClusterRunner();

    // create ES nodes
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingBuilder) {
        }
    }).build(
            newConfigs()
                    .clusterName("es-auth" + System.currentTimeMillis())
                    .ramIndexStore().numOfNode(1));

    // wait for yellow status
    runner.ensureYellow();
}
 
开发者ID:codelibs,项目名称:elasticsearch-auth,代码行数:19,代码来源:AuthPluginTest.java


示例16: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    // create runner instance
    clusterName = "es-river-web-" + UUID.randomUUID().toString();
    runner = new ElasticsearchClusterRunner();
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.put("index.number_of_shards", 3);
            settingsBuilder.put("index.number_of_replicas", 0);
            settingsBuilder.putArray("discovery.zen.ping.unicast.hosts", "localhost:9301-9310");
            settingsBuilder.put("index.unassigned.node_left.delayed_timeout", "0");
            settingsBuilder.put("network.host", "0");
        }
    }).build(newConfigs().clusterName(clusterName).numOfNode(numOfNode));

    // wait for yellow status
    runner.ensureYellow();
}
 
开发者ID:codelibs,项目名称:elasticsearch-river-web,代码行数:22,代码来源:RiverWebTest.java


示例17: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    // create runner instance
    runner = new ElasticsearchClusterRunner();
    // create ES nodes
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.putArray("discovery.zen.ping.unicast.hosts", "localhost:9301-9399");
            settingsBuilder.put("plugin.types", "org.codelibs.elasticsearch.sample.SamplePlugin");
        }
    }).build(
            newConfigs()
                    .clusterName("es-cl-run-" + System.currentTimeMillis())
                    .numOfNode(3));

    // wait for yellow status
    runner.ensureYellow();
}
 
开发者ID:codelibs,项目名称:elasticsearch-plugin-sample,代码行数:22,代码来源:SamplePluginTests.java


示例18: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@BeforeClass
public static void setUp() throws IOException {

    runner = new ElasticsearchClusterRunner();

    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Settings.Builder settingsBuilder) {
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.putArray("discovery.zen.ping.unicast.hosts", CLUSTER_HOST_ADDRESS);
        }
    }).build(ElasticsearchClusterRunner.newConfigs().clusterName(CLUSTER_NAME).numOfNode(1)
            .pluginTypes("st.malike.elastic.report.engine.ElasticReportPlugin"));

    runner.ensureYellow();

    //setupup dummy data        
    final String type = "reporttype";

    // create an index
    runner.createIndex(INDEX, (Settings) null);

    // create documents
    for (int i = 1; i <= DOC_SIZE; i++) {
        runner.insert(INDEX, type, String.valueOf(i),
                "{"
                        + "\"type\":\"" + randomCDIndicator().toString() + "\","
                        + "\"description\":\"Transaction " + i + "\","
                        + "\"id\":" + i
                        + "}");
    }
    runner.refresh();

    SearchResponse searchResponse = runner.search(INDEX, type, null, null, 0, 10);
    assertEquals(DOC_SIZE, searchResponse.getHits().getTotalHits());

    node = runner.node();
}
 
开发者ID:malike,项目名称:elasticsearch-report-engine,代码行数:40,代码来源:ElasticReportPluginTest.java


示例19: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    clusterName = "es-kuromojineologd-" + System.currentTimeMillis();
    runner = new ElasticsearchClusterRunner();
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.putList("discovery.zen.ping.unicast.hosts", "localhost:9301-9310");
        }
    }).build(newConfigs().clusterName(clusterName).numOfNode(numOfNode)
            .pluginTypes("org.codelibs.elasticsearch.fess.FessAnalysisPlugin"));
}
 
开发者ID:codelibs,项目名称:elasticsearch-analysis-fess,代码行数:15,代码来源:FessAnalysisPluginTest.java


示例20: setUp

import org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    clusterName = "es-analysisja-" + System.currentTimeMillis();
    runner = new ElasticsearchClusterRunner();
    runner.onBuild(new ElasticsearchClusterRunner.Builder() {
        @Override
        public void build(final int number, final Builder settingsBuilder) {
            settingsBuilder.put("http.cors.enabled", true);
            settingsBuilder.put("http.cors.allow-origin", "*");
            settingsBuilder.putList("discovery.zen.ping.unicast.hosts", "localhost:9301-9310");
        }
    }).build(newConfigs().clusterName(clusterName).numOfNode(numOfNode).pluginTypes("org.codelibs.elasticsearch.ja.JaPlugin"));

}
 
开发者ID:codelibs,项目名称:elasticsearch-analysis-ja,代码行数:15,代码来源:FlexiblePorterStemFilterFactoryTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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