(self, tags)
return running_apps
Return a dictionary of {app_id: (app_name, tracking_url)} for running Spark applications.

        The `app_id` returned is that of the YARN application. This will eventually be mapped into
        a Spark application ID.
Return a dictionary of {app_id: (app_name, tracking_url)} for running Spark applications.
Return a dictionary of { app_id : ( app_name tracking_url ) } for running Spark applications .
def _yarn_get_running_spark_apps(self, tags):
        """
        Return a dictionary of {app_id: (app_name, tracking_url)} for running Spark applications.

        The `app_id` returned is that of the YARN application. This will eventually be mapped into
        a Spark application ID.
        """
        metrics_json = self._rest_request_to_json(
            self.master_address,
            YARN_APPS_PATH,
            YARN_SERVICE_CHECK,
            tags,
            states=APPLICATION_STATES,
            applicationTypes=YARN_APPLICATION_TYPES,
        )

        running_apps = {}

        if metrics_json.get('apps'):
            if metrics_json['apps'].get('app') is not None:

                for app_json in metrics_json['apps']['app']:
                    app_id = app_json.get('id')
                    tracking_url = app_json.get('trackingUrl')
                    app_name = app_json.get('name')

                    if app_id and tracking_url and app_name:
                        running_apps[app_id] = (app_name, tracking_url)

        return running_apps
def _yarn_get_running_spark_apps ( self , tags ) : metrics_json = self . _rest_request_to_json ( self . master_address , YARN_APPS_PATH , YARN_SERVICE_CHECK , tags , states = APPLICATION_STATES , applicationTypes = YARN_APPLICATION_TYPES , ) running_apps = { } if metrics_json . get ( 'apps' ) : if metrics_json [ 'apps' ] . get ( 'app' ) is not None : for app_json in metrics_json [ 'apps' ] [ 'app' ] : app_id = app_json . get ( 'id' ) tracking_url = app_json . get ( 'trackingUrl' ) app_name = app_json . get ( 'name' ) if app_id and tracking_url and app_name : running_apps [ app_id ] = ( app_name , tracking_url ) return running_apps