当前位置: 首页>>代码示例>>Java>>正文


Java GroovyPlugin类代码示例

本文整理汇总了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);
}
 
开发者ID:xushjie1987,项目名称:es-hadoop-v2.2.0,代码行数:24,代码来源:EsEmbeddedServer.java

示例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());
  }

}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:52,代码来源:ElasticsearchCluster.java

示例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


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