def _process_spark_submit_log(self, itr):
<EOL>for line in itr:<EOL><INDENT>line = line.strip()<EOL>if self._is_yarn and self._connection['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>match = re.search('<STR_LIT>', line)<EOL>if match:<EOL><INDENT>self._yarn_application_id = match.groups()[<NUM_LIT:0>]<EOL>self.log.info("<STR_LIT>",<EOL>self._yarn_application_id)<EOL><DEDENT><DEDENT>elif self._is_kubernetes:<EOL><INDENT>match = re.search(r'<STR_LIT>', line)<EOL>if match:<EOL><INDENT>self._kubernetes_driver_pod = match.groups()[<NUM_LIT:0>]<EOL>self.log.info("<STR_LIT>",<EOL>self._kubernetes_driver_pod)<EOL><DEDENT>match_exit_code = re.search(r'<STR_LIT>', line)<EOL>if match_exit_code:<EOL><INDENT>self._spark_exit_code = int(match_exit_code.groups()[<NUM_LIT:0>])<EOL><DEDENT><DEDENT>elif self._should_track_driver_status and not self._driver_id:<EOL><INDENT>match_driver_id = re.search(r'<STR_LIT>', line)<EOL>if match_driver_id:<EOL><INDENT>self._driver_id = match_driver_id.groups()[<NUM_LIT:0>]<EOL>self.log.info("<STR_LIT>"<EOL>.format(self._driver_id))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.log.info(line)<EOL><DEDENT>self.log.debug("<STR_LIT>".format(line))<EOL><DEDENT>
Processes the log files and extracts useful information out of it.

If the deploy-mode is 'client', log the output of the submit command as those
are the output logs of the Spark worker directly.

Remark: If the driver needs to be tracked for its status, the log-level of the
spark deploy needs to be at least INFO (log4j.logger.org.apache.spark.deploy=INFO)

:param itr: An iterator which iterates over the input of the subprocess