Package com.hazelcast.jet.elastic
Class ElasticClients
- java.lang.Object
-
- com.hazelcast.jet.elastic.ElasticClients
-
public final class ElasticClients extends java.lang.Object
Collection of convenience factory methods for Elastic'sRestClientBuilder
Supposed to be used as a parameter to
ElasticSourceBuilder.clientFn(SupplierEx)
andElasticSinkBuilder.clientFn(SupplierEx)
, for example:builder.clientFn(() -> client());
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.elasticsearch.client.RestClientBuilder
client()
Create Elastic client for an instance running on localhost on default port (9200)static org.elasticsearch.client.RestClientBuilder
client(java.lang.String location)
Convenience method to createRestClientBuilder
with given string, it must contain host, and optionally the scheme and a port.static org.elasticsearch.client.RestClientBuilder
client(java.lang.String hostname, int port)
Convenience method to createRestClientBuilder
with given hostname and portstatic org.elasticsearch.client.RestClientBuilder
client(java.lang.String username, java.lang.String password, java.lang.String hostname, int port)
Convenience method to createRestClientBuilder
with basic authentication and given hostname and portstatic org.elasticsearch.client.RestClientBuilder
client(java.lang.String username, java.lang.String password, java.lang.String hostname, int port, java.lang.String scheme)
Convenience method to createRestClientBuilder
with basic authentication and given hostname, port and scheme.
-
-
-
Method Detail
-
client
@Nonnull public static org.elasticsearch.client.RestClientBuilder client()
Create Elastic client for an instance running on localhost on default port (9200)
-
client
@Nonnull public static org.elasticsearch.client.RestClientBuilder client(@Nonnull java.lang.String location)
Convenience method to createRestClientBuilder
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 java.lang.String hostname, int port)
Convenience method to createRestClientBuilder
with given hostname and port
-
client
@Nonnull public static org.elasticsearch.client.RestClientBuilder client(@Nonnull java.lang.String username, @Nonnull java.lang.String password, @Nonnull java.lang.String hostname, int port)
Convenience method to createRestClientBuilder
with basic authentication and given hostname and portUsage:
BatchSource<SearchHit> source = elastic(() -> client("user", "password", "host", 9200));
-
client
@Nonnull public static org.elasticsearch.client.RestClientBuilder client(@Nonnull java.lang.String username, @Nonnull java.lang.String password, @Nonnull java.lang.String hostname, int port, @Nonnull java.lang.String scheme)
Convenience method to createRestClientBuilder
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"));
-
-