in pulsar-io/elastic-search/src/main/java/org/apache/pulsar/io/elasticsearch/ElasticSearchConfig.java [104:121]
public void validate() {
if (StringUtils.isEmpty(elasticSearchUrl) || StringUtils.isEmpty(indexName)) {
throw new IllegalArgumentException("Required property not set.");
}
if ((StringUtils.isNotEmpty(username) && StringUtils.isEmpty(password))
|| (StringUtils.isEmpty(username) && StringUtils.isNotEmpty(password))) {
throw new IllegalArgumentException("Values for both Username & password are required.");
}
if (indexNumberOfShards < 1) {
throw new IllegalArgumentException("indexNumberOfShards must be a strictly positive integer");
}
if (indexNumberOfReplicas < 0) {
throw new IllegalArgumentException("indexNumberOfReplicas must be a positive integer");
}
}