T
- The type of the element handled by this ElasticsearchSinkFunction
ElasticsearchSinkFunction
instead.@Deprecated public interface ElasticsearchSinkFunction<T> extends Serializable, Function
ActionRequest
s from an element in a Stream.
This is used by ElasticsearchSink
to prepare elements for sending them to Elasticsearch.
Example:
private static class TestElasticSearchSinkFunction implements
ElasticsearchSinkFunction<Tuple2<Integer, String>> {
public IndexRequest createIndexRequest(Tuple2<Integer, String> element) {
Map<String, Object> json = new HashMap<>();
json.put("data", element.f1);
return Requests.indexRequest()
.index("my-index")
.type("my-type")
.id(element.f0.toString())
.source(json);
}
public void process(Tuple2<Integer, String> element, RuntimeContext ctx, RequestIndexer indexer) {
indexer.add(createIndexRequest(element));
}
}
Modifier and Type | Method and Description |
---|---|
void |
process(T element,
RuntimeContext ctx,
RequestIndexer indexer)
Deprecated.
|
void process(T element, RuntimeContext ctx, RequestIndexer indexer)
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.