(self)
Determine what mode was specified
Determine what mode was specified
Determine what mode was specified
def _get_running_apps(self):
        """
        Determine what mode was specified
        """
        tags = list(self.tags)

        tags.append('spark_cluster:%s' % self.cluster_name)
        if not self._disable_legacy_cluster_tag:
            tags.append('cluster_name:%s' % self.cluster_name)

        if self.cluster_mode == SPARK_STANDALONE_MODE:
            # check for PRE-20
            pre20 = is_affirmative(self.instance.get(SPARK_PRE_20_MODE, False))
            return self._standalone_init(pre20, tags)

        elif self.cluster_mode == SPARK_MESOS_MODE:
            running_apps = self._mesos_init(tags)
            return self._get_spark_app_ids(running_apps, tags)

        elif self.cluster_mode == SPARK_YARN_MODE:
            running_apps = self._yarn_init(tags)
            return self._get_spark_app_ids(running_apps, tags)

        elif self.cluster_mode == SPARK_DRIVER_MODE:
            return self._driver_init(tags)

        else:
            raise Exception('Invalid setting for %s. Received %s.' % (SPARK_CLUSTER_MODE, self.cluster_mode))
def _get_running_apps ( self ) : tags = list ( self . tags ) tags . append ( 'spark_cluster:%s' % self . cluster_name ) if not self . _disable_legacy_cluster_tag : tags . append ( 'cluster_name:%s' % self . cluster_name ) if self . cluster_mode == SPARK_STANDALONE_MODE : # check for PRE-20 pre20 = is_affirmative ( self . instance . get ( SPARK_PRE_20_MODE , False ) ) return self . _standalone_init ( pre20 , tags ) elif self . cluster_mode == SPARK_MESOS_MODE : running_apps = self . _mesos_init ( tags ) return self . _get_spark_app_ids ( running_apps , tags ) elif self . cluster_mode == SPARK_YARN_MODE : running_apps = self . _yarn_init ( tags ) return self . _get_spark_app_ids ( running_apps , tags ) elif self . cluster_mode == SPARK_DRIVER_MODE : return self . _driver_init ( tags ) else : raise Exception ( 'Invalid setting for %s. Received %s.' % ( SPARK_CLUSTER_MODE , self . cluster_mode ) )