def _interpret_history_log(fs, matches):
 for match in matches:
  path = match['path']
  if match['yarn']:
   result = _parse_yarn_history_log(_cat_log(fs, path))
  else:
   result = _parse_pre_yarn_history_log(_cat_log(fs, path))
  for error in (result.get('errors') or ()):
   if ('hadoop_error' in error):
    error['hadoop_error']['path'] = path
   _add_implied_task_id(error)
  return result
 return {}

def _interpret_history_log ( fs , matches ) : for match in matches : path = match [ 'path' ] if match [ 'yarn' ] : result = _parse_yarn_history_log ( _cat_log ( fs , path ) ) else : result = _parse_pre_yarn_history_log ( _cat_log ( fs , path ) ) for error in ( result . get ( 'errors' ) or ( ) ) : if ( 'hadoop_error' in error ) : error [ 'hadoop_error' ] [ 'path' ] = path _add_implied_task_id ( error ) return result return { }
extract counters and errors from history log .