@SuppressWarnings({"unchecked"})
  public OutputCollector getCollector(String namedOutput, String multiName,
                                      Reporter reporter)
    throws IOException {

    checkNamedOutputName(namedOutput);
    if (!namedOutputs.contains(namedOutput)) {
      throw new IllegalArgumentException("Undefined named output '" +
        namedOutput + "'");
    }
    boolean multi = isMultiNamedOutput(conf, namedOutput);

    if (!multi && multiName != null) {
      throw new IllegalArgumentException("Name output '" + namedOutput +
        "' has not been defined as multi");
    }
    if (multi) {
      checkTokenName(multiName);
    }

    String baseFileName = (multi) ? namedOutput + "_" + multiName : namedOutput;

    final RecordWriter writer =
      getRecordWriter(namedOutput, baseFileName, reporter);

    return new OutputCollector() {

      @SuppressWarnings({"unchecked"})
      public void collect(Object key, Object value) throws IOException {
        writer.write(key, value);
      }

    };
  }
@ SuppressWarnings ( { "unchecked" } ) public OutputCollector getCollector ( String namedOutput , String multiName , Reporter reporter ) throws IOException { checkNamedOutputName ( namedOutput ) ; if ( ! namedOutputs . contains ( namedOutput ) ) { throw new IllegalArgumentException ( "Undefined named output '" + namedOutput + "'" ) ; } boolean multi = isMultiNamedOutput ( conf , namedOutput ) ; if ( ! multi && multiName != null ) { throw new IllegalArgumentException ( "Name output '" + namedOutput + "' has not been defined as multi" ) ; } if ( multi ) { checkTokenName ( multiName ) ; } String baseFileName = ( multi ) ? namedOutput + "_" + multiName : namedOutput ; final RecordWriter writer = getRecordWriter ( namedOutput , baseFileName , reporter ) ; return new OutputCollector ( ) { @ SuppressWarnings ( { "unchecked" } ) public void collect ( Object key , Object value ) throws IOException { writer . write ( key , value ) ; } } ; }
Gets the output collector for a multi named output.
<p/>

@param namedOutput the named output name
@param multiName   the multi name part
@param reporter    the reporter
@return the output collector for the given named output
@throws IOException thrown if output collector could not be created