Hadoop Programming (Khái niệm cơ bản về lập trình Hadoop MapReduce)
Tài liệu giới thiệu các khái niệm cơ bản về lập trình Hadoop MapReduce bao gồm kiến trúc MapReduce, các định dạng vào/ra, tuần tự hóa Writable, và cấu hình Job.
Generating preview...
Hadoop Programming Overview MapReduce Types Input Formats Output Formats Serialization Job http://hadoop.apache.org/docs/r2.2.0/api/or g/apache/hadoop/mapreduce/packagesummary.html Mapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT> Maps input key/value pairs to a set of intermediate key/value pairs. Maps are the individual tasks which transform input records into a intermediate records. The transformed intermediate records need not be of the same type as the input records. A given input pair may map to zero or many output pairs. The Hadoop Map-Reduce framework spawns one map task for each InputSplit generated by the InputFormat for the job. The framework first calls setup(org.apache.hadoop.mapreduce.Mapper.Context), followed by map(Object, Object, Context) for each key/value pair in the InputSplit. Finally cleanup(Context) is called. http://hadoop.apache.org/docs/r2.2.0/api/org/apache/hadoop/mapreduce/Mapper.ht ml public static class TokenizerMapper extends Mapper<Object, Text, Text, IntWritable>{ private final static IntWritable one = new IntWritable(1); private Text word = new Text(); public void map(Object key, Text value, Context context ) throws IOException, InterruptedException { StringTokenizer itr = new StringTokenizer(value.toString()); while (itr.hasMoreTokens()) { word.set(itr.nextToken()); context.write(word, one); } } } What is Writable? Hadoop defines its own “box” classes for strings (Text), integers (IntWritable), etc. All values are instances of Writable All keys are instances of WritableComparable Writable A serializable object which implements a simple, efficient, serialization protocol, based on DataInput and DataOutput. Any key or value type in the Hadoop Map-Reduce framework implements this interface. Implementations typically implement a static read(DataInput) method which constructs a new instance, calls readFields(DataInput) and returns the instance. http://hadoop.apache.org/docs/r2.2.0/api/or g/apache/hadoop
… Download the original file to read the full document.
- Document name
- Hadoop Programming (Khái niệm cơ bản về lập trình Hadoop MapReduce)
- School / Course
- University of Maryland · Khai phá dữ liệu
- Content
- Tài liệu này giới thiệu về lập trình Hadoop, tập trung vào mô hình MapReduce, các thành phần như Mapper, định dạng dữ liệu Writable, và cách cấu hình một Job MapReduce.
- Table of contents
- Overview
- Mapper
- What is Writable?
- Writable
- Getting Data To The Mapper
- Pages
- 33 pages
- Uploaded by
- Giang Le
Frequently asked questions
Is this document free?
Yes. “Hadoop Programming (Khái niệm cơ bản về lập trình Hadoop MapReduce)” is free — just sign in and click Download to get the original file.
How many pages is this document?
The document has 33 pages, for the course Khai phá dữ liệu. You can preview it online before downloading.
Can I preview before downloading?
Yes. You can preview this document right on this page with the online reader, then decide whether to download.

Comments (0)
No comments yet. Be the first!