<commit_before>/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 *
 * Copyright 2017 Nextdoor.com, Inc
 *
 */

package com.nextdoor.bender.ipc.es;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaDefault;
import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaDescription;
import com.nextdoor.bender.aws.auth.AuthConfig;
import com.nextdoor.bender.ipc.http.AbstractHttpTransportConfig;

@JsonTypeName("ElasticSearch")
public class ElasticSearchTransportConfig extends AbstractHttpTransportConfig {

  @JsonSchemaDescription("Authentication scheme.")
  @JsonProperty(required = false)
  private AuthConfig<?> authConfig = null;

  @JsonSchemaDescription("ElasticSearch HTTP endpoint port.")
  @JsonSchemaDefault(value = "9200")
  @JsonProperty(required = false)
  @Min(1)
  @Max(65535)
  private Integer port = 9200;

  @JsonSchemaDescription("Index to write to.")
  @JsonProperty(required = true)
  private String index;

  @JsonSchemaDescription("ElasticSearch document type.")
  @JsonProperty(required = true)
  private String documentType;

  @JsonSchemaDescription("ElasticSearch bulk api path including leading slash '/'.")
  @JsonSchemaDefault(value = "/_bulk")
  @JsonProperty(required = false)
  private String bulkApiPath = "/_bulk";

  @JsonSchemaDescription("Java time format to append to index name.")
  @JsonProperty(required = false)
  private String indexTimeFormat = null;

  @JsonSchemaDescription("Use hash id generated by Bender as document id.")
  @JsonSchemaDefault(value = "false")
  @JsonProperty(required = false)
  private Boolean useHashId = false;

  public AuthConfig<?> getAuthConfig() {
    return this.authConfig;
  }

  public void setAuthConfig(AuthConfig<?> authConfig) {
    this.authConfig = authConfig;
  }

  public Integer getPort() {
    return port;
  }

  public void setPort(Integer port) {
    this.port = port;
  }

  public String getIndex() {
    return index;
  }

  public void setIndex(String index) {
    this.index = index;
  }

  public String getDocumentType() {
    return documentType;
  }

  public void setDocumentType(String documentType) {
    this.documentType = documentType;
  }

  public String getIndexTimeFormat() {
    return indexTimeFormat;
  }

  public void setIndexTimeFormat(String indexTimeFormat) {
    this.indexTimeFormat = indexTimeFormat;
  }

  @JsonProperty("use_hashid")
  public Boolean isUseHashId() {
    return useHashId;
  }

  @JsonProperty("use_hashid")
  public void setUseHashId(Boolean useHashId) {
    this.useHashId = useHashId;
  }

  public String getBulkApiPath() {
    return this.bulkApiPath;
  }

  public void setBulkApiPath(String bulkApiPath) {
    this.bulkApiPath = bulkApiPath;
  }

  @Override
  public Class<?> getFactoryClass() {
    return ElasticSearchTransportFactory.class;
  }

}
<commit_msg>Update ES docs<commit_after>/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 *
 * Copyright 2017 Nextdoor.com, Inc
 *
 */

package com.nextdoor.bender.ipc.es;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaDefault;
import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaDescription;
import com.nextdoor.bender.aws.auth.AuthConfig;
import com.nextdoor.bender.ipc.http.AbstractHttpTransportConfig;

@JsonTypeName("ElasticSearch")
@JsonSchemaDescription("Writes to an ElasticSearch cluster. When using AWS hosted ES do not "
    + "use gzip compression.")
public class ElasticSearchTransportConfig extends AbstractHttpTransportConfig {

  @JsonSchemaDescription("Authentication scheme.")
  @JsonProperty(required = false)
  private AuthConfig<?> authConfig = null;

  @JsonSchemaDescription("ElasticSearch HTTP endpoint port.")
  @JsonSchemaDefault(value = "9200")
  @JsonProperty(required = false)
  @Min(1)
  @Max(65535)
  private Integer port = 9200;

  @JsonSchemaDescription("Index to write to.")
  @JsonProperty(required = true)
  private String index;

  @JsonSchemaDescription("ElasticSearch document type.")
  @JsonProperty(required = true)
  private String documentType;

  @JsonSchemaDescription("ElasticSearch bulk api path including leading slash '/'.")
  @JsonSchemaDefault(value = "/_bulk")
  @JsonProperty(required = false)
  private String bulkApiPath = "/_bulk";

  @JsonSchemaDescription("Java time format to append to index name.")
  @JsonProperty(required = false)
  private String indexTimeFormat = null;

  @JsonSchemaDescription("Use hash id generated by Bender as document id.")
  @JsonSchemaDefault(value = "false")
  @JsonProperty(required = false)
  private Boolean useHashId = false;

  public AuthConfig<?> getAuthConfig() {
    return this.authConfig;
  }

  public void setAuthConfig(AuthConfig<?> authConfig) {
    this.authConfig = authConfig;
  }

  public Integer getPort() {
    return port;
  }

  public void setPort(Integer port) {
    this.port = port;
  }

  public String getIndex() {
    return index;
  }

  public void setIndex(String index) {
    this.index = index;
  }

  public String getDocumentType() {
    return documentType;
  }

  public void setDocumentType(String documentType) {
    this.documentType = documentType;
  }

  public String getIndexTimeFormat() {
    return indexTimeFormat;
  }

  public void setIndexTimeFormat(String indexTimeFormat) {
    this.indexTimeFormat = indexTimeFormat;
  }

  @JsonProperty("use_hashid")
  public Boolean isUseHashId() {
    return useHashId;
  }

  @JsonProperty("use_hashid")
  public void setUseHashId(Boolean useHashId) {
    this.useHashId = useHashId;
  }

  public String getBulkApiPath() {
    return this.bulkApiPath;
  }

  public void setBulkApiPath(String bulkApiPath) {
    this.bulkApiPath = bulkApiPath;
  }

  @Override
  public Class<?> getFactoryClass() {
    return ElasticSearchTransportFactory.class;
  }

}

{'fraction_non_alphanumeric': 0.09278926774734489, 'fraction_numerical': 0.006148686416992733, 'mean_word_length': 4.5138674884437595, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6444380', 'n_tokens_mistral': 2100, 'n_tokens_neox': 2018, 'n_words': 571}