public final class ElasticSinks extends Object
ElasticSinkBuilder
Modifier and Type | Method and Description |
---|---|
static ElasticSinkBuilder<Void> |
builder()
Returns new instance of
ElasticSinkBuilder |
static <T> Sink<T> |
elastic(FunctionEx<? super T,? extends org.elasticsearch.action.DocWriteRequest<?>> mapToRequestFn)
Creates an Elasticsearch sink, uses a local instance of Elasticsearch
|
static <T> Sink<T> |
elastic(SupplierEx<org.elasticsearch.client.RestClientBuilder> clientFn,
FunctionEx<? super T,? extends org.elasticsearch.action.DocWriteRequest<?>> mapToRequestFn)
Creates an Elasticsearch sink, uses a client obtained from
clientFn and maps items using given mapToRequestFn
|
@Nonnull public static <T> Sink<T> elastic(@Nonnull FunctionEx<? super T,? extends org.elasticsearch.action.DocWriteRequest<?>> mapToRequestFn)
Usage:
Sink<Map<String, Object>> sink = ElasticSinks.elastic(
map -> new IndexRequest("my-index").source(map)
);
mapToRequestFn
- function that maps an item from a pipeline
to an indexing request@Nonnull public static <T> Sink<T> elastic(@Nonnull SupplierEx<org.elasticsearch.client.RestClientBuilder> clientFn, @Nonnull FunctionEx<? super T,? extends org.elasticsearch.action.DocWriteRequest<?>> mapToRequestFn)
Usage:
Sink
T
- type of incoming itemsclientFn
- supplier function returning configured RestClientBuildermapToRequestFn
- function that maps an item from a pipeline to an indexing request@Nonnull public static ElasticSinkBuilder<Void> builder()
ElasticSinkBuilder
Copyright © 2023 Hazelcast, Inc.. All rights reserved.