Class ElasticsearchCommitterConfig


public class ElasticsearchCommitterConfig extends BaseBatchCommitterConfig
  • Field Details

    • DEFAULT_ELASTICSEARCH_CONTENT_FIELD

      public static final String DEFAULT_ELASTICSEARCH_CONTENT_FIELD
      See Also:
    • DEFAULT_NODE

      public static final String DEFAULT_NODE
      See Also:
    • DEFAULT_CONNECTION_TIMEOUT

      public static final Duration DEFAULT_CONNECTION_TIMEOUT
      1 second.
    • DEFAULT_SOCKET_TIMEOUT

      public static final Duration DEFAULT_SOCKET_TIMEOUT
      30 seconds.
  • Constructor Details

    • ElasticsearchCommitterConfig

      public ElasticsearchCommitterConfig()
  • Method Details

    • getNodes

      public List<String> getNodes()
      Gets an unmodifiable list of Elasticsearch cluster node URLs. Defaults to "http://localhost:9200".
      Returns:
      Elasticsearch nodes
    • setNodes

      public void setNodes(List<String> nodes)
      Sets cluster node URLs. Node URLs with no port are assumed to be using port 80.
      Parameters:
      nodes - Elasticsearch cluster nodes
    • getCredentials

      public Credentials getCredentials()
      Gets Elasticsearch authentication credentials.
      Returns:
      credentials
    • setCredentials

      public void setCredentials(Credentials credentials)
      Sets Elasticsearch authentication credentials.
      Parameters:
      credentials - the credentials
    • getIndexName

      public String getIndexName()
      The Elasticsearch index name.
    • getTypeName

      public String getTypeName()
      The type name. Type name is deprecated if you are using Elasticsearch 7.0 or higher and should be null.
    • isIgnoreResponseErrors

      public boolean isIgnoreResponseErrors()
      Whether to ignore response errors. By default, an exception is thrown if the Elasticsearch response contains an error. When true the errors are logged instead.
    • isDiscoverNodes

      public boolean isDiscoverNodes()
      Whether automatic discovery of Elasticsearch cluster nodes should be enabled.
    • getApiKey

      public String getApiKey()
      The Base64-encoded API key for Elasticsearch API Key authentication. When set, takes precedence over basic credentials. The value should be the Base64-encoded API key as provided by Elasticsearch (i.e., the value sent in the Authorization: ApiKey ... header).
    • getDotReplacement

      public String getDotReplacement()
      The character used to replace dots in field names. Default is null (does not replace dots).
    • getJsonFieldsPattern

      public String getJsonFieldsPattern()
      The regular expression matching fields that contains a JSON object for its value (as opposed to a regular string). Default is null (not matching any fields).
    • getConnectionTimeout

      @NonNull public @NonNull Duration getConnectionTimeout()
      Elasticsearch connection timeout. Defaults to value of DEFAULT_CONNECTION_TIMEOUT
    • getSocketTimeout

      @NonNull public @NonNull Duration getSocketTimeout()
      Elasticsearch socket timeout.
    • isFixBadIds

      public boolean isFixBadIds()
      Whether to fix IDs that are too long for Elasticsearch ID limitation (512 bytes max). If true, long IDs will be truncated and a hash code representing the truncated part will be appended.
    • getSourceIdField

      public String getSourceIdField()
      The document field name containing the value to be stored in Elasticsearch "_id" field. Set to null to use the document reference instead of a field (default).
    • getTargetContentField

      public String getTargetContentField()
      The name of the Elasticsearch field where content will be stored. Default is "content". A null value disables storing the content.
    • setIndexName

      public ElasticsearchCommitterConfig setIndexName(String indexName)
      The Elasticsearch index name.
      Returns:
      this.
    • setTypeName

      public ElasticsearchCommitterConfig setTypeName(String typeName)
      The type name. Type name is deprecated if you are using Elasticsearch 7.0 or higher and should be null.
      Returns:
      this.
    • setIgnoreResponseErrors

      public ElasticsearchCommitterConfig setIgnoreResponseErrors(boolean ignoreResponseErrors)
      Whether to ignore response errors. By default, an exception is thrown if the Elasticsearch response contains an error. When true the errors are logged instead.
      Returns:
      this.
    • setDiscoverNodes

      public ElasticsearchCommitterConfig setDiscoverNodes(boolean discoverNodes)
      Whether automatic discovery of Elasticsearch cluster nodes should be enabled.
      Returns:
      this.
    • setApiKey

      public ElasticsearchCommitterConfig setApiKey(String apiKey)
      The Base64-encoded API key for Elasticsearch API Key authentication. When set, takes precedence over basic credentials. The value should be the Base64-encoded API key as provided by Elasticsearch (i.e., the value sent in the Authorization: ApiKey ... header).
      Returns:
      this.
    • setDotReplacement

      public ElasticsearchCommitterConfig setDotReplacement(String dotReplacement)
      The character used to replace dots in field names. Default is null (does not replace dots).
      Returns:
      this.
    • setJsonFieldsPattern

      public ElasticsearchCommitterConfig setJsonFieldsPattern(String jsonFieldsPattern)
      The regular expression matching fields that contains a JSON object for its value (as opposed to a regular string). Default is null (not matching any fields).
      Returns:
      this.
    • setConnectionTimeout

      public ElasticsearchCommitterConfig setConnectionTimeout(@NonNull @NonNull Duration connectionTimeout)
      Elasticsearch connection timeout. Defaults to value of DEFAULT_CONNECTION_TIMEOUT
      Returns:
      this.
    • setSocketTimeout

      public ElasticsearchCommitterConfig setSocketTimeout(@NonNull @NonNull Duration socketTimeout)
      Elasticsearch socket timeout.
      Returns:
      this.
    • setFixBadIds

      public ElasticsearchCommitterConfig setFixBadIds(boolean fixBadIds)
      Whether to fix IDs that are too long for Elasticsearch ID limitation (512 bytes max). If true, long IDs will be truncated and a hash code representing the truncated part will be appended.
      Returns:
      this.
    • setSourceIdField

      public ElasticsearchCommitterConfig setSourceIdField(String sourceIdField)
      The document field name containing the value to be stored in Elasticsearch "_id" field. Set to null to use the document reference instead of a field (default).
      Returns:
      this.
    • setTargetContentField

      public ElasticsearchCommitterConfig setTargetContentField(String targetContentField)
      The name of the Elasticsearch field where content will be stored. Default is "content". A null value disables storing the content.
      Returns:
      this.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class BaseBatchCommitterConfig
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class BaseBatchCommitterConfig
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class BaseBatchCommitterConfig
    • toString

      public String toString()
      Overrides:
      toString in class BaseBatchCommitterConfig