T
- Type of the elements handled by this sinkElasticsearchSink
@Deprecated @PublicEvolving public class ElasticsearchSink<T> extends ElasticsearchSinkBase<T,org.elasticsearch.client.RestHighLevelClient>
ActionRequests
against a
cluster for each incoming element.
The sink internally uses a RestHighLevelClient
to communicate with an Elasticsearch
cluster. The sink will fail if no cluster can be connected to using the provided transport
addresses passed to the constructor.
Internally, the sink will use a BulkProcessor
to send ActionRequests
. This will buffer elements before sending a request to the cluster. The behaviour
of the BulkProcessor
can be configured using these config keys:
bulk.flush.max.actions
: Maximum amount of elements to buffer
bulk.flush.max.size.mb
: Maximum amount of data (in megabytes) to buffer
bulk.flush.interval.ms
: Interval at which to flush data regardless of the other two
settings in milliseconds
You also have to provide an ElasticsearchSinkFunction
. This is used to create multiple
ActionRequests
for each incoming element. See the class level documentation
of ElasticsearchSinkFunction
for an example.
Modifier and Type | Class and Description |
---|---|
static class |
ElasticsearchSink.Builder<T>
Deprecated.
This has been deprecated, please use
Elasticsearch6SinkBuilder . |
ElasticsearchSinkBase.BulkFlushBackoffPolicy, ElasticsearchSinkBase.FlushBackoffType
SinkFunction.Context
CONFIG_KEY_BULK_FLUSH_BACKOFF_DELAY, CONFIG_KEY_BULK_FLUSH_BACKOFF_ENABLE, CONFIG_KEY_BULK_FLUSH_BACKOFF_RETRIES, CONFIG_KEY_BULK_FLUSH_BACKOFF_TYPE, CONFIG_KEY_BULK_FLUSH_INTERVAL_MS, CONFIG_KEY_BULK_FLUSH_MAX_ACTIONS, CONFIG_KEY_BULK_FLUSH_MAX_SIZE_MB
buildBulkProcessor, close, disableFlushOnCheckpoint, initializeState, invoke, open, snapshotState
getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
finish, invoke, writeWatermark
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.