class_docstr: Base builder to construct a ElasticsearchSink.
class_docstr_tok: ["Base","builder","to","construct","a","ElasticsearchSink","."]
docstr: Sets the hosts where the Elasticsearch cluster nodes are reachable.
code: def set_hosts(
      self, hosts: Union[str, List[str]]
  ) -> "ElasticsearchSinkBuilderBase":
      """
      Sets the hosts where the Elasticsearch cluster nodes are reachable.
      """
      if not isinstance(hosts, list):
          hosts = [hosts]
      JHttpHost = self.get_http_host_class()
      j_http_hosts_list = [JHttpHost.create(x) for x in hosts]
      j_http_hosts_array = to_jarray(JHttpHost, j_http_hosts_list)
      self._j_elasticsearch_sink_builder.setHosts(j_http_hosts_array)
      return self
  
imports: import abc
  from enum import Enum
  from typing import List, Union
  from pyflink.datastream.connectors import Sink, DeliveryGuarantee
  from pyflink.java_gateway import get_gateway
  from pyflink.util.java_utils import to_jarray
label_desc: Use image node_id 4 for calling the ElasticsearchSinkBuilderBase obj's underlying member method code with example usage: obj.set_hosts(hosts) and returns: self