private static JobConf getChainElementConf(JobConf jobConf, String confKey) {
    JobConf conf;
    try {
      Stringifier<JobConf> stringifier =
        new DefaultStringifier<JobConf>(jobConf, JobConf.class);
      conf = stringifier.fromString(jobConf.get(confKey, null));
    } catch (IOException ioex) {
      throw new RuntimeException(ioex);
    }
    // we have to do this because the Writable desearialization clears all
    // values set in the conf making not possible do do a new JobConf(jobConf)
    // in the creation of the conf above
    jobConf = new JobConf(jobConf);

    for(Map.Entry<String, String> entry : conf) {
      jobConf.set(entry.getKey(), entry.getValue());
    }
    return jobConf;
  }
private static JobConf getChainElementConf ( JobConf jobConf , String confKey ) { JobConf conf ; try { Stringifier < JobConf > stringifier = new DefaultStringifier < JobConf > ( jobConf , JobConf . class ) ; conf = stringifier . fromString ( jobConf . get ( confKey , null ) ) ; } catch ( IOException ioex ) { throw new RuntimeException ( ioex ) ; } jobConf = new JobConf ( jobConf ) ; for ( Map . Entry < String , String > entry : conf ) { jobConf . set ( entry . getKey ( ) , entry . getValue ( ) ) ; } return jobConf ; }
Creates a {@link JobConf} for one of the Maps or Reduce in the chain.
<p/>
It creates a new JobConf using the chain job's JobConf as base and adds to
it the configuration properties for the chain element. The keys of the
chain element jobConf have precedence over the given JobConf.

@param jobConf the chain job's JobConf.
@param confKey the key for chain element configuration serialized in the
chain job's JobConf.
@return a new JobConf aggregating the chain job's JobConf with the chain
element configuration properties.