pyflink.datastream.connectors.elasticsearch.Elasticsearch7SinkBuilder#
- class Elasticsearch7SinkBuilder[source]#
Builder to construct an Elasticsearch 7 compatible ElasticsearchSink.
The following example shows the minimal setup to create a ElasticsearchSink that submits actions on checkpoint or the default number of actions was buffered (1000).
Example:
>>> sink = Elasticsearch7SinkBuilder() \ ... .set_hosts('localhost:9200') \ ... .set_emitter(ElasticsearchEmitter.dynamic_index("index_col", "key_col")) \ ... .build()
Methods
build()Constructs the ElasticsearchSink with the properties configured this builder.
get_http_host_class()Gets the org.apache.http.HttpHost class which path is different in different Elasticsearch version.
set_bulk_flush_backoff_strategy(...)Sets the type of back off to use when flushing bulk requests.
set_bulk_flush_interval(interval_millis)Sets the bulk flush interval, in milliseconds.
set_bulk_flush_max_actions(num_max_actions)Sets the maximum number of actions to buffer for each bulk request.
set_bulk_flush_max_size_mb(max_size_mb)Sets the maximum size of buffered actions, in mb, per bulk request.
set_connection_password(password)Sets the password used to authenticate the connection with the Elasticsearch cluster.
set_connection_path_prefix(prefix)Sets a prefix which used for every REST communication to the Elasticsearch cluster.
set_connection_request_timeout(timeout)Sets the timeout for requesting the connection of the Elasticsearch cluster from the connection manager.
set_connection_timeout(timeout)Sets the timeout for establishing a connection of the Elasticsearch cluster.
set_connection_username(username)Sets the username used to authenticate the connection with the Elasticsearch cluster.
set_delivery_guarantee(delivery_guarantee)Sets the wanted DeliveryGuarantee.
set_emitter(emitter)Sets the emitter which is invoked on every record to convert it to Elasticsearch actions.
set_hosts(hosts)Sets the hosts where the Elasticsearch cluster nodes are reachable.
set_socket_timeout(timeout)Sets the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets.