本文整理汇总了Java中org.elasticsearch.script.groovy.GroovyPlugin类的典型用法代码示例。如果您正苦于以下问题:Java GroovyPlugin类的具体用法?Java GroovyPlugin怎么用?Java GroovyPlugin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GroovyPlugin类属于org.elasticsearch.script.groovy包,在下文中一共展示了GroovyPlugin类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EsEmbeddedServer
import org.elasticsearch.script.groovy.GroovyPlugin; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public EsEmbeddedServer(String clusterName, String homePath, String dataPath, String httpRange, String transportRange, boolean hasSlave) {
Properties props = new Properties();
props.setProperty("path.home", homePath);
props.setProperty("path.data", dataPath);
props.setProperty("http.port", httpRange);
props.setProperty("transport.tcp.port", transportRange);
props.setProperty("cluster.name", "es.hadoop.test");
props.setProperty("node.local", "true");
//props.setProperty("es.index.store.type", "memory");
// props.setProperty("gateway.type", "none");
if (!hasSlave) {
props.setProperty("discovery.zen.ping.multicast", "false");
props.setProperty("discovery.zen.ping.multicast.enabled", "false");
}
//props.setProperty("script.disable_dynamic", "false");
props.setProperty("script.inline", "true");
props.setProperty("script.indexed", "true");
Settings settings = NodeBuilder.nodeBuilder().local(false).client(false).settings(Settings.settingsBuilder().put(props).build()).clusterName(clusterName).getSettings().build();
Collection plugins = Arrays.asList(GroovyPlugin.class);
node = new PluginConfigurableNode(settings, plugins);
}
示例2: initServer
import org.elasticsearch.script.groovy.GroovyPlugin; //导入依赖的package包/类
private void initServer(int size, Boolean publishHost, Integer presetSSLPort){
for (int i = 0; i < size; i++) {
File data = Files.createTempDir();
data.deleteOnExit();
File home = Files.createTempDir();
home.deleteOnExit();
String name = NODE_NAME_PREFIX + i;
Settings.Builder settingsBuilder = Settings.builder()
.put("node.name", name)
.put("path.home", home.getAbsolutePath())
.put("path.data", data.getAbsolutePath())
.put("cluster.routing.allocation.disk.threshold_enabled", false)
.put("node.local", true)
.put("node.data", true)
.put("cluster.name", CLUSTER_NAME)
.put("script.inline", scriptsEnabled)
.put("script.max_compilations_per_minute", 200)
.put("script.indexed", scriptsEnabled);
if (publishHost) {
settingsBuilder
.put("http.publish_host", "localhost")
.put("http.publish_port", ELASTICSEARCH_PORT);
}
if (sslEnabled) {
File keystoreFile = new File("target/tests/ssl/" + name + ".jks");
String password = "dummy";
genCertificate(keystoreFile, password);
sslPort = setupSSLProxy(keystoreFile, password, "127.0.0.1", ELASTICSEARCH_PORT, presetSSLPort);
// we must tell elastic to advertise the proxy instead
settingsBuilder
.put("http.publish_host", "localhost")
.put("http.publish_port", sslPort);
}
Settings settings = settingsBuilder.build();
ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>(2);
plugins.add(MapperAttachmentsPlugin.class);
plugins.add(GroovyPlugin.class);
nodes[i] = new ElasticTestNode(settings, plugins); // nodeBuilder().settings(settings).node();
logger.info("--> Elasticsearch node [{} (cluster: {}, home: {}, data: {}] started", name, CLUSTER_NAME,
home.getAbsolutePath(), data.getAbsolutePath());
}
}
示例3: nodePlugins
import org.elasticsearch.script.groovy.GroovyPlugin; //导入依赖的package包/类
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return pluginList(GroovyPlugin.class, MultipleMetricPlugin.class);
}
开发者ID:eliep,项目名称:elasticsearch-multiple-metric-aggregation,代码行数:5,代码来源:MultipleMetricAggregationTestCase.java