本文整理汇总了Java中org.codelibs.elasticsearch.runner.ElasticsearchClusterRunner类的典型用法代码示例。如果您正苦于以下问题:Java ElasticsearchClusterRunner类的具体用法?Java ElasticsearchClusterRunner怎么用?Java ElasticsearchClusterRunner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ElasticsearchClusterRunner类属于org.codelibs.elasticsearch.runner包,在下文中一共展示了ElasticsearchClusterRunner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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));
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}