Class ElasticClients

java.lang.Object
com.hazelcast.jet.elastic.ElasticClients

@Deprecated(forRemoval=true, since="5.7") public final class ElasticClients extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Collection of convenience factory methods for Elastic's RestClientBuilder

Supposed to be used as a parameter to ElasticSourceBuilder.clientFn(SupplierEx) and ElasticSinkBuilder.clientFn(SupplierEx), for example:


 builder.clientFn(() -> client());
 
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.elasticsearch.client.RestClientBuilder
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create Elastic client for an instance running on localhost on default port (9200)
    static org.elasticsearch.client.RestClientBuilder
    client(String location)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Convenience method to create RestClientBuilder with given string, it must contain host, and optionally the scheme and a port.
    static org.elasticsearch.client.RestClientBuilder
    client(String hostname, int port)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Convenience method to create RestClientBuilder with given hostname and port
    static org.elasticsearch.client.RestClientBuilder
    client(String username, String password, String hostname, int port)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Convenience method to create RestClientBuilder with basic authentication and given hostname and port
    static org.elasticsearch.client.RestClientBuilder
    client(String username, String password, String hostname, int port, String scheme)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Convenience method to create RestClientBuilder with basic authentication and given hostname, port and scheme.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • client

      @Nonnull public static org.elasticsearch.client.RestClientBuilder client()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create Elastic client for an instance running on localhost on default port (9200)
    • client

      @Nonnull public static org.elasticsearch.client.RestClientBuilder client(@Nonnull String location)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Convenience method to create RestClientBuilder with given string, it must contain host, and optionally the scheme and a port.

      Valid examples:

      elastic-host
       elastic-host:9200
       http://elastic-host:9200
      Since:
      Jet 4.3
      See Also:
      • HttpHost.create(String)
    • client

      @Nonnull public static org.elasticsearch.client.RestClientBuilder client(@Nonnull String hostname, int port)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Convenience method to create RestClientBuilder with given hostname and port
    • client

      @Nonnull public static org.elasticsearch.client.RestClientBuilder client(@Nonnull String username, @Nonnull String password, @Nonnull String hostname, int port)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Convenience method to create RestClientBuilder with basic authentication and given hostname and port

      Usage:

      
       BatchSource<SearchHit> source = elastic(() -> client("user", "password", "host", 9200));
       
    • client

      @Nonnull public static org.elasticsearch.client.RestClientBuilder client(@Nonnull String username, @Nonnull String password, @Nonnull String hostname, int port, @Nonnull String scheme)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Convenience method to create RestClientBuilder with basic authentication and given hostname, port and scheme. Valid schemes are "http" and "https".

      Usage:

      
       BatchSource<SearchHit> source = elastic(() -> client("user", "password", "host", 9200, "https"));