Class ElasticsearchSinkBuilderBase<IN,​B extends ElasticsearchSinkBuilderBase<IN,​B>>

  • Type Parameters:
    IN - type of the records converted to Elasticsearch actions

    @PublicEvolving
    public abstract class ElasticsearchSinkBuilderBase<IN,​B extends ElasticsearchSinkBuilderBase<IN,​B>>
    extends Object
    Base builder to construct a ElasticsearchSink.
    • Constructor Detail

      • ElasticsearchSinkBuilderBase

        protected ElasticsearchSinkBuilderBase()
    • Method Detail

      • setEmitter

        public <T extends INElasticsearchSinkBuilderBase<T,​?> setEmitter​(ElasticsearchEmitter<? super T> emitter)
        Sets the emitter which is invoked on every record to convert it to Elasticsearch actions.
        Parameters:
        emitter - to process records into Elasticsearch actions.
        Returns:
        this builder
      • setHosts

        public B setHosts​(org.apache.http.HttpHost... hosts)
        Sets the hosts where the Elasticsearch cluster nodes are reachable.
        Parameters:
        hosts - http addresses describing the node locations
        Returns:
        this builder
      • setDeliveryGuarantee

        public B setDeliveryGuarantee​(org.apache.flink.connector.base.DeliveryGuarantee deliveryGuarantee)
        Sets the wanted DeliveryGuarantee. The default delivery guarantee is DeliveryGuarantee.NONE
        Parameters:
        deliveryGuarantee - which describes the record emission behaviour
        Returns:
        this builder
      • setBulkFlushMaxActions

        public B setBulkFlushMaxActions​(int numMaxActions)
        Sets the maximum number of actions to buffer for each bulk request. You can pass -1 to disable it. The default flush size 1000.
        Parameters:
        numMaxActions - the maximum number of actions to buffer per bulk request.
        Returns:
        this builder
      • setBulkFlushMaxSizeMb

        public B setBulkFlushMaxSizeMb​(int maxSizeMb)
        Sets the maximum size of buffered actions, in mb, per bulk request. You can pass -1 to disable it.
        Parameters:
        maxSizeMb - the maximum size of buffered actions, in mb.
        Returns:
        this builder
      • setBulkFlushInterval

        public B setBulkFlushInterval​(long intervalMillis)
        Sets the bulk flush interval, in milliseconds. You can pass -1 to disable it.
        Parameters:
        intervalMillis - the bulk flush interval, in milliseconds.
        Returns:
        this builder
      • setBulkFlushBackoffStrategy

        public B setBulkFlushBackoffStrategy​(FlushBackoffType flushBackoffType,
                                             int maxRetries,
                                             long delayMillis)
        Sets the type of back off to use when flushing bulk requests. The default bulk flush back off type is FlushBackoffType.NONE.

        Sets the amount of delay between each backoff attempt when flushing bulk requests, in milliseconds.

        Sets the maximum number of retries for a backoff attempt when flushing bulk requests.

        Parameters:
        flushBackoffType - the backoff type to use.
        Returns:
        this builder
      • setConnectionUsername

        public B setConnectionUsername​(String username)
        Sets the username used to authenticate the connection with the Elasticsearch cluster.
        Parameters:
        username - of the Elasticsearch cluster user
        Returns:
        this builder
      • setConnectionPassword

        public B setConnectionPassword​(String password)
        Sets the password used to authenticate the connection with the Elasticsearch cluster.
        Parameters:
        password - of the Elasticsearch cluster user
        Returns:
        this builder
      • setConnectionPathPrefix

        public B setConnectionPathPrefix​(String prefix)
        Sets a prefix which used for every REST communication to the Elasticsearch cluster.
        Parameters:
        prefix - for the communication
        Returns:
        this builder
      • setConnectionRequestTimeout

        public B setConnectionRequestTimeout​(int timeout)
        Sets the timeout for requesting the connection of the Elasticsearch cluster from the connection manager.
        Parameters:
        timeout - for the connection request
        Returns:
        this builder
      • setConnectionTimeout

        public B setConnectionTimeout​(int timeout)
        Sets the timeout for establishing a connection of the Elasticsearch cluster.
        Parameters:
        timeout - for the connection
        Returns:
        this builder
      • setSocketTimeout

        public B setSocketTimeout​(int timeout)
        Sets the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets.
        Parameters:
        timeout - for the socket
        Returns:
        this builder
      • getBulkProcessorBuilderFactory

        protected abstract org.apache.flink.connector.elasticsearch.sink.BulkProcessorBuilderFactory getBulkProcessorBuilderFactory()