Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hadoop >> mail # user >> map.input.file in Hadoop 0.20.0 map/reduce...


Copy link to this message
-
map.input.file in Hadoop 0.20.0 map/reduce...

   In migrating from the mapred.* classes to mapreduce.* classes I noticed I am not able to get "map.input.file" from the configuration returned from the Map.Context getConfiguration() method.  I didn't see an obvious answer but poking around I found I could get the file name as follows:

     public void setup(Context context) {
         FileSplit fileSplit = (FileSplit)context.getInputSplit();
         String input_fname = fileSplit.getPath().toString();
    }

   Which is basically what is done in mapred.MapTask.

    That seems reasonable.  I guess my question is does that seem right?  Does it seem like an oversight to no longer set "map.input.file" or is it suggested to use context.getInputSplit() and get the filename from there.

    Thanks

    Andy
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB