(self)
return running_apps
Return a dictionary of {app_id: (app_name, tracking_url)} for the running MapReduce applications
Return a dictionary of {app_id: (app_name, tracking_url)} for the running MapReduce applications
Return a dictionary of { app_id : ( app_name tracking_url ) } for the running MapReduce applications
def _get_running_app_ids(self):
        """
        Return a dictionary of {app_id: (app_name, tracking_url)} for the running MapReduce applications
        """
        metrics_json = self._rest_request_to_json(
            self.rm_address,
            self.YARN_APPS_PATH,
            self.YARN_SERVICE_CHECK,
            states=self.YARN_APPLICATION_STATES,
            applicationTypes=self.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 _get_running_app_ids ( self ) : metrics_json = self . _rest_request_to_json ( self . rm_address , self . YARN_APPS_PATH , self . YARN_SERVICE_CHECK , states = self . YARN_APPLICATION_STATES , applicationTypes = self . 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