



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




















Building Map Reduce November 27th, 2007
Open Source contribution project
due Dec 4th
Homework 5: a simple Hadoop project
due Dec 6th
Project 4: implementing Map Reduce from scratch
due Dec 11th
Bigger than other projects (about 1000 lines of code)
Not going to be spoon fed
leave a lot of the details up to you, much of the suggested implementation strategies are just suggestions
Not many unit tests, mostly end-to-end tests
We have a distributed reliable file system
MapReduce is build on top of Google File System
We don’t worry about file system failure
We don’t have to worry about locality, all files are equidistant from all processors
Common/shared code base; don’t need to worry about shipping map/reduce code to cluster nodes
One master node: job is submitted here
JobRunners: available to run any MapReduce tasks, announce their availability by broadcasting a ServerLocation every second
Master listens for announcements, waits until it has enough job runners or until 10 seconds elapse
We will use text files as our input source
all files in a directory that have a name ending in .txt
handle all line ending encodings
Write output files into an output directory using Object serialization
a set of files, each of which consists of
key1, value1, key2, value2, ...
Listens for connections on a server socket
Accepts a connection, uses an ObjectInputStream to read a task, executes it
send back a heart beat
false, false, false, ..., false, true
one value per second
In theory, the input to the mapper could be anything
In practice, we are going to only handle splits of text files
InputKey is a FileIndex (contains a File and a position)
InputValue is a String (which starts at that file index)
OK, we have a set of files, each of variable length
We have a desired # of ranges to split it into
Consider the following situation:
10 splits requested
one file containing 1 gigabyte of data
9 files containing 100 bytes of data
If asked for m splits of n files
generate m full sized splits,
each no bigger than ceil (totalSize/m)
up to n small splits
Exact details up to you
Hint: having each Map task reading each line of text, starting at the beginning of the file, until it gets to the right position, is not efficient
The tasks that sent to JobRunners are tasks
each has an id, a unique number
we will use the numbers to ensure that each task writes to distinct files, and to allow us to clean up or ignore output of failed jobs
Map task writes all generated key/value pairs, in sequence, to
phase1/{partition#}/{taskID}
Separate file for each partition
each key,value pair written to the file for its partition
Assigned a partition
Read all files in phase1/{partition#}
exclude any files from failed jobs
Might be too big to fit all into memory
we are thinking “big”