class_docstr: Controls a stand-alone Spark cluster for integration tests.
  Tests can run forked, but not in parallel.
  Multiple controller instances would restart each other's masters.
class_docstr_tok: ["Controls","a","stand-alone","Spark","cluster","for","integration","tests",".","Tests","can","run","forked",",","but","not","in","parallel",".","Multiple","controller","instances","would","restart","each","other","'s","masters","."]
code: def start_worker(self, instance, cores):
      logging.info(
          "starting Spark worker %d with %d cores", instance, cores
      )
      res = self._execute(
          "env PYTHONPATH={pythonpath} "
          "{spark_home}/sbin/spark-daemon.sh "
          "start org.apache.spark.deploy.worker.Worker {instance} "
          "-c {cores} "
          "{master_url}".format(
              pythonpath=os.pathsep.join(sys.path),
              spark_home=self._spark_home,
              instance=instance,
              cores=cores,
              master_url=self.master_url(),
          )
      )
      if not res or res[1]:
          return False
  
      self._workers.append(instance)
      self._worker_logs[instance] = self._get_log_file(res[0])
      return True
  
imports: from __future__ import absolute_import
  import contextlib
  import json
  import logging
  import os
  import re
  import sys
  import threading
  import time
  import warnings
  import mock
  from parameterized import parameterized
  import pytest
  import unittest
  from horovod.runner.util.threads import in_thread
  from horovod.runner.common.util import safe_shell_exec, tiny_shell_exec
  from horovod.spark import conf, run_elastic
  from common import temppath
label_desc: Use image node_id 8 for calling the SparkClusterController obj's underlying member method code with example usage: obj.start_worker(instance, cores) and returns: True, False