class_docstr: A node provider that implements provider for nodes of Ray on spark.
class_docstr_tok: ["A","node","provider","that","implements","provider","for","nodes","of","Ray","on","spark","."]
code: def terminate_node(self, node_id):
      if node_id in self._nodes:
          response = requests.post(
              url=self.spark_job_server_url + "/terminate_node",
              json={
                  "spark_job_group_id": self._gen_spark_job_group_id(
                      node_id
                  )
              },
          )
          response.raise_for_status()
  
      with self.lock:
          if node_id in self._nodes:
              self._nodes.pop(node_id)
  
      logger.info(f"Spark node provider terminates node {node_id}")
  
imports: import json
  import logging
  import sys
  from threading import RLock
  from typing import Any, Dict, Optional
  import requests
  from ray.autoscaler.node_launch_exception import NodeLaunchException
  from ray.autoscaler.node_provider import NodeProvider
  from ray.autoscaler.tags import NODE_KIND_HEAD, NODE_KIND_WORKER, STATUS_SETTING_UP, STATUS_UP_TO_DATE, TAG_RAY_NODE_KIND, TAG_RAY_NODE_NAME, TAG_RAY_NODE_STATUS, TAG_RAY_USER_NODE_TYPE
label_desc: Use image node_id 16 for calling the SparkNodeProvider obj's underlying member method code with example usage: obj.terminate_node(node_id) without return types