當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。