T - The type of the element handled by this IndexRequestBuilderElasticsearchSink using a ElasticsearchSinkFunction instead.@Deprecated public interface IndexRequestBuilder<T> extends org.apache.flink.api.common.functions.Function, Serializable
IndexRequest from an element in a Stream.
This is used by ElasticsearchSink
to prepare elements for sending them to Elasticsearch. See
Index API
for information about how to format data for adding it to an Elasticsearch index.
Example:
private static class MyIndexRequestBuilder implements IndexRequestBuilder<String> {
public IndexRequest createIndexRequest(String element, RuntimeContext ctx) {
Map<String, Object> json = new HashMap<>();
json.put("data", element);
return Requests.indexRequest()
.index("my-index")
.type("my-type")
.source(json);
}
}
| Modifier and Type | Method and Description |
|---|---|
org.elasticsearch.action.index.IndexRequest |
createIndexRequest(T element,
org.apache.flink.api.common.functions.RuntimeContext ctx)
Deprecated.
Creates an
IndexRequest from an element. |
org.elasticsearch.action.index.IndexRequest createIndexRequest(T element, org.apache.flink.api.common.functions.RuntimeContext ctx)
IndexRequest from an element.element - The element that needs to be turned in to an IndexRequestctx - The Flink RuntimeContext of the ElasticsearchSinkIndexRequestCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.