private void addToMap(HashMap<OperatorPair,AffinityRule> affinitiesMap,AffinityRule rule,OperatorPair operators){
  OperatorMeta operator1=getOperatorMeta(operators.first);
  OperatorMeta operator2=getOperatorMeta(operators.second);
  if (operator1 == null || operator2 == null) {
    if (operator1 == null && operator2 == null) {
      throw new ValidationException(String.format("Operators %s & %s specified in affinity rule are not part of the dag",operators.first,operators.second));
    }
    throw new ValidationException(String.format("Operator %s specified in affinity rule is not part of the dag",operator1 == null ? operators.first : operators.second));
  }
  affinitiesMap.put(operators,rule);
}

private void addToMap ( HashMap < OperatorPair , AffinityRule > affinitiesMap , AffinityRule rule , OperatorPair operators ) { OperatorMeta operator1 = getOperatorMeta ( operators . first ) ; OperatorMeta operator2 = getOperatorMeta ( operators . second ) ; if ( operator1 == null || operator2 == null ) { if ( operator1 == null && operator2 == null ) { throw new ValidationException ( String . format ( "Operators %s & %s specified in affinity rule are not part of the dag" , operators . first , operators . second ) ) ; } throw new ValidationException ( String . format ( "Operator %s specified in affinity rule is not part of the dag" , operator1 == null ? operators . first : operators . second ) ) ; } affinitiesMap . put ( operators , rule ) ; }
validates that operators in affinity rule are valid : checks that operator names are part of the dag and adds them to map of rules
