parameters: (self)
docstring: Retrieve the resource which is connected to a healthy node
docstring_summary: Retrieve the resource which is connected to a healthy node
docstring_tokens: Retrieve the resource which is connected to a healthy node
function: def get_healthy_resource(self):
          """Retrieve the resource which is connected to a healthy node"""
  
          for healthcheck_url, request_url in zip(
              self.healthcheck_urls, self.request_urls
          ):
              try:
                  resource, columns, raw_dtypes = core_ops.io_elasticsearch_readable_init(
                      healthcheck_url=healthcheck_url,
                      healthcheck_field="status",
                      request_url=request_url,
                      headers=self.headers,
                  )
                  print(f"Connection successful: {healthcheck_url}")
                  dtypes = []
                  for dtype in raw_dtypes:
                      if dtype == "DT_INT32":
                          dtypes.append(tf.int32)
                      elif dtype == "DT_INT64":
                          dtypes.append(tf.int64)
                      elif dtype == "DT_DOUBLE":
                          dtypes.append(tf.double)
                      elif dtype == "DT_STRING":
                          dtypes.append(tf.string)
                      elif dtype == "DT_BOOL":
                          dtypes.append(tf.bool)
                  return resource, columns.numpy(), dtypes, request_url
              except Exception:
                  print(f"Skipping node: {healthcheck_url}")
                  continue
          else:
              raise ConnectionError(
                  "No healthy node available for the index: {}, please check the cluster config".format(
                      self.index
                  )
              )
function_tokens: def get_healthy_resource ( self ) : for healthcheck_url , request_url in zip ( self . healthcheck_urls , self . request_urls ) : try : resource , columns , raw_dtypes = core_ops . io_elasticsearch_readable_init ( healthcheck_url = healthcheck_url , healthcheck_field = "status" , request_url = request_url , headers = self . headers , ) print ( f"Connection successful: {healthcheck_url}" ) dtypes = [ ] for dtype in raw_dtypes : if dtype == "DT_INT32" : dtypes . append ( tf . int32 ) elif dtype == "DT_INT64" : dtypes . append ( tf . int64 ) elif dtype == "DT_DOUBLE" : dtypes . append ( tf . double ) elif dtype == "DT_STRING" : dtypes . append ( tf . string ) elif dtype == "DT_BOOL" : dtypes . append ( tf . bool ) return resource , columns . numpy ( ) , dtypes , request_url except Exception : print ( f"Skipping node: {healthcheck_url}" ) continue else : raise ConnectionError ( "No healthy node available for the index: {}, please check the cluster config" . format ( self . index ) )