Upgrading To The New Map Reduce API

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    6 Favorites

    Upgrading To The New Map Reduce API - Presentation Transcript

    1. September 23 rd , 2009 Yahoo! welcomes you to the Hadoop Bay Area User Group
    2. Agenda
      • Upgrading to the New MapReduce API
        • Owen O'Malley, Yahoo!
      • Mining the web with Hadoop, Cascading & Bixo
        • Ken Krugler
      • QnA and Open Discussion
    3. September 23 rd , 2009 Upgrading to the New MapReduce API
    4. Top Level Changes
      • Change all of the “mapred” packages to “mapreduce”.
      • Methods can throw InterruptedException as well as IOException.
      • Use Configuration instead of JobConf
      • Library classes moved to mapreduce.lib.{input,map,output,partition,reduce}.*
      • Don’t Panic!
    5. Mapper
      • Change map function signature from:
        • map(K1 key, V1 value,
        • OutputCollector<K2,V2> output,
        • Reporter reporter)
        • map(K1 key, V1 value, Context context)
        • context replaces output and reporter.
      • Change close() to
        • cleanup(Context context)
    6. Mapper (cont)
      • Change output.collect(K,V) to
        • context.write(K,V)
      • Also have setup(Context context) that can replace your configure method.
    7. MapRunnable
      • Use mapreduce.Mapper
      • Change from:
        • void run(RecordReader<K1,V1> input,
        • OutputCollector<K2,V2> output,
        • Reporter reporter)
        • void run(Context context)
    8. Reducer and Combiner
      • Replace:
        • void reduce(K2, Iterator<V2> values,
        • OutputCollector<K3,V3> output)
        • void reduce(K2, Iterable<V2> values,
        • Context context)
      • Also replace close() with:
        • void cleanup(Context context)
      • Also have setup and run!
    9. Reducer and Combiner (cont)
      • Replace
        • while (values.hasNext()) {
        • V2 value = values.next(); … }
        • for(V2 value: values) { … }
      • Users of the grouping comparator can use context.getCurrentKey to get the real current key.
    10. Submitting Jobs
      • Replace the JobConf and JobClient with Job.
        • The Job represents the entire job instead of just the configuration.
        • Set properties of the job.
        • Get the status of the job.
        • Wait for job to complete.
    11. Submitting Jobs (cont)
      • Job constructor:
        • job = new JobConf(conf, MyMapper.class)
        • job.setJobName(“job name”)
        • job = new Job(conf, “job name”)
        • job.setJarByClass(MyMapper.class)
      • Job has getConfiguration
      • FileInputFormat in mapreduce.lib.input
      • FileOutputFormat in mapreduce.lib.output
    12. Submitting Jobs (cont)
      • Replace:
        • JobClient.runJob(job)
        • System.exit(job.waitForCompletion(true)?0:1)
    13. InputFormats
      • Replace:
        • InputSplit[] getSplits(JobConf job, int numSplits)
        • List<InputSplit> getSplits(JobContext context)
      • Replace:
        • RecordReader<K,V>
        • getRecordReader(InputSplit split, JobConf job,
        • Reporter reporter)
        • RecordReader<K,V>
        • createRecordReader(InputSplit split,
        • TaskAttemptContext context)
    14. InputFormat (cont)
      • There is no replacement for numSplits (mapred.map.tasks).
      • FileInputFormat just uses:
        • block size
        • mapreduce.input.fileinputformat.minsize
        • mapreduce.input.fileinputformat.maxsize
      • Replace MultiFileInputFormat with CombineFileInputFormat
    15. RecordReader
      • Replace:
        • boolean next(K key, V value)
        • K createKey()
        • V createValue()
      • With:
        • boolean nextKeyValue()
        • K getCurrentKey()
        • V getCurrentValue()
    16. RecordReader (cont)
      • The interface supports generic serialization formats instead of just Writable.
      • Note that the getCurrentKey and getCurrentValue may or may not return the same object.
      • The getPos method has gone away since not all RecordReaders have byte positions.
    17. OutputFormat
      • Replace
        • RecordWriter<K,V>
        • getRecordWriter(FileSystem ignored,
        • JobConf conf,
        • String name,
        • Progressable progress)
        • RecordWriter<K,V>
        • getRecordWriter(TaskAttemptContext ctx)
    18. OutputContext (cont)
      • Replace:
        • void checkOutputSpecs(FileSystem ignore,
        • JobConf conf)
        • void checkOutputSpecs(JobContext ctx)
      • The OutputCommitter is returned by the OutputFormat instead of configured separately!
    19. Cluster Information (in 21)
      • Replace JobClient with Cluster.
      • Replace ClusterStatus with ClusterMetrics
      • Replace RunningJob with JobStatus
    20. September 23 rd , 2009 Mining the web with Hadoop, Cascading & Bixo
    21. Thank you. See you at the next Bay Area User Group Oct 21 st , 2009

    + Tom Hughes-CroucherTom Hughes-Croucher, 1 month ago

    custom

    1773 views, 6 favs, 3 embeds more stats

    Opening presentation from Yahoo! for the Hadoop Use more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1773
      • 1147 on SlideShare
      • 626 from embeds
    • Comments 0
    • Favorites 6
    • Downloads 31
    Most viewed embeds
    • 623 views on http://developer.yahoo.net
    • 2 views on http://translate.googleusercontent.com
    • 1 views on http://developer.yahoo.com

    more

    All embeds
    • 623 views on http://developer.yahoo.net
    • 2 views on http://translate.googleusercontent.com
    • 1 views on http://developer.yahoo.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories