boolean isLocal = false;
for( JobConf fromJob : fromJobs )
{
if( fromJob.get( "mapred.input.format.class" ) == null )
throw new CascadingException( "mapred.input.format.class is required, should be set in source Scheme#sourceConfInit" );
configs.add( HadoopUtil.getConfig( toJob, fromJob ) );
Collections.addAll( allPaths, FileInputFormat.getInputPaths( fromJob ) );
if( !isLocal )
isLocal = HadoopUtil.isLocal( fromJob );
}
if( !allPaths.isEmpty() ) // it's possible there aren't any
FileInputFormat.setInputPaths( toJob, (Path[]) allPaths.toArray( new Path[ allPaths.size() ] ) );
try
{
toJob.set( "cascading.multiinputformats", HadoopUtil.serializeBase64( configs, toJob, true ) );
}
catch( IOException exception )
{
throw new CascadingException( "unable to pack input formats", exception );
}
if( isLocal )
HadoopUtil.setLocal( toJob );
}