T - Type of the elements handled by the sink this builder creates.@PublicEvolving public static class ElasticsearchSink.Builder<T> extends Object
ElasticsearchSink.| Constructor and Description |
|---|
Builder(List<org.apache.http.HttpHost> httpHosts,
org.apache.flink.streaming.connectors.elasticsearch.ElasticsearchSinkFunction<T> elasticsearchSinkFunction)
Creates a new
ElasticsearchSink that connects to the cluster using a RestHighLevelClient. |
| Modifier and Type | Method and Description |
|---|---|
ElasticsearchSink<T> |
build()
Creates the Elasticsearch sink.
|
boolean |
equals(Object o) |
int |
hashCode() |
void |
setBulkFlushBackoff(boolean enabled)
Sets whether or not to enable bulk flush backoff behaviour.
|
void |
setBulkFlushBackoffDelay(long delayMillis)
Sets the amount of delay between each backoff attempt when flushing bulk requests, in
milliseconds.
|
void |
setBulkFlushBackoffRetries(int maxRetries)
Sets the maximum number of retries for a backoff attempt when flushing bulk requests.
|
void |
setBulkFlushBackoffType(org.apache.flink.streaming.connectors.elasticsearch.ElasticsearchSinkBase.FlushBackoffType flushBackoffType)
Sets the type of back of to use when flushing bulk requests.
|
void |
setBulkFlushInterval(long intervalMillis)
Sets the bulk flush interval, in milliseconds.
|
void |
setBulkFlushMaxActions(int numMaxActions)
Sets the maximum number of actions to buffer for each bulk request.
|
void |
setBulkFlushMaxSizeMb(int maxSizeMb)
Sets the maximum size of buffered actions, in mb, per bulk request.
|
void |
setFailureHandler(org.apache.flink.streaming.connectors.elasticsearch.ActionRequestFailureHandler failureHandler)
Sets a failure handler for action requests.
|
void |
setRestClientFactory(RestClientFactory restClientFactory)
Sets a REST client factory for custom client configuration.
|
public Builder(List<org.apache.http.HttpHost> httpHosts, org.apache.flink.streaming.connectors.elasticsearch.ElasticsearchSinkFunction<T> elasticsearchSinkFunction)
ElasticsearchSink that connects to the cluster using a RestHighLevelClient.httpHosts - The list of HttpHost to which the RestHighLevelClient
connects to.elasticsearchSinkFunction - This is used to generate multiple ActionRequest
from the incoming element.public void setBulkFlushMaxActions(int numMaxActions)
numMaxActions - the maximum number of actions to buffer per bulk request.public void setBulkFlushMaxSizeMb(int maxSizeMb)
maxSizeMb - the maximum size of buffered actions, in mb.public void setBulkFlushInterval(long intervalMillis)
intervalMillis - the bulk flush interval, in milliseconds.public void setBulkFlushBackoff(boolean enabled)
enabled - whether or not to enable backoffs.public void setBulkFlushBackoffType(org.apache.flink.streaming.connectors.elasticsearch.ElasticsearchSinkBase.FlushBackoffType flushBackoffType)
flushBackoffType - the backoff type to use.public void setBulkFlushBackoffRetries(int maxRetries)
maxRetries - the maximum number of retries for a backoff attempt when flushing bulk
requestspublic void setBulkFlushBackoffDelay(long delayMillis)
delayMillis - the amount of delay between each backoff attempt when flushing bulk
requests, in milliseconds.public void setFailureHandler(org.apache.flink.streaming.connectors.elasticsearch.ActionRequestFailureHandler failureHandler)
failureHandler - This is used to handle failed ActionRequest.public void setRestClientFactory(RestClientFactory restClientFactory)
restClientFactory - the factory that configures the rest client.public ElasticsearchSink<T> build()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.