def _parse_pre_yarn_counters(counters_str):
 counters = {}
 for group_match in _PRE_YARN_COUNTER_GROUP_RE.finditer(counters_str):
  group_name = _pre_yarn_history_unescape(group_match.group('group_name'))
  group_counters = {}
  for counter_match in _PRE_YARN_COUNTER_RE.finditer(group_match.group('counter_list_str')):
   counter_name = _pre_yarn_history_unescape(counter_match.group('counter_name'))
   amount = int(counter_match.group('amount'))
   group_counters[counter_name] = amount
  counters[group_name] = group_counters
 return counters

def _parse_pre_yarn_counters ( counters_str ) : counters = { } for group_match in _PRE_YARN_COUNTER_GROUP_RE . finditer ( counters_str ) : group_name = _pre_yarn_history_unescape ( group_match . group ( 'group_name' ) ) group_counters = { } for counter_match in _PRE_YARN_COUNTER_RE . finditer ( group_match . group ( 'counter_list_str' ) ) : counter_name = _pre_yarn_history_unescape ( counter_match . group ( 'counter_name' ) ) amount = int ( counter_match . group ( 'amount' ) ) group_counters [ counter_name ] = amount counters [ group_name ] = group_counters return counters
parse a counters field from a pre-yarn history file .