Skip to content

Commit 4d3d7df

Browse files
committed
fix check es host
1 parent bdcd0bb commit 4d3d7df

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSourceSplitEnumerator.java

+3
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ public void notifyCheckpointComplete(long checkpointId) throws Exception {}
207207

208208
public List<IndexDocsCount> getIndexDocsCount(String index) {
209209
List<String> hosts = connConfig.get(ElasticsearchBaseOptions.HOSTS);
210+
if (hosts.isEmpty()) {
211+
throw new IllegalArgumentException("hosts must not be null nor empty");
212+
}
210213
String endpoint =
211214
String.format(
212215
"%s/_cat/indices/%s?h=index,docsCount&format=json", hosts.get(0), index);

0 commit comments

Comments
 (0)