public static String addNamedOutput ( Job job , String namedOutput , OutputFormat outputFormat , Class < ? > keyClass , Class < ? > valueClass ) throws FileNotFoundException , IOException , URISyntaxException { checkNamedOutputName ( job , namedOutput , true ) ; Configuration conf = job . getConfiguration ( ) ; String uniqueName = UUID . randomUUID ( ) . toString ( ) + ' ' + "out-format.dat" ; InstancesDistributor . distribute ( outputFormat , uniqueName , conf ) ; conf . set ( MULTIPLE_OUTPUTS , conf . get ( MULTIPLE_OUTPUTS , "" ) + " " + namedOutput ) ; conf . set ( MO_PREFIX + namedOutput + FORMAT_INSTANCE_FILE , uniqueName ) ; conf . setClass ( MO_PREFIX + namedOutput + KEY , keyClass , Object . class ) ; conf . setClass ( MO_PREFIX + namedOutput + VALUE , valueClass , Object . class ) ; return uniqueName ; }
Adds a named output for the job . Returns the instance file that has been created .