Logical View
The Map and Reduce functions of MapReduce are both defined with respect to data structured in (key, value) pairs. Map takes one pair of data with a type in one data domain, and returns a list of pairs in a different domain: Map(k1,v1)
→ list(k2,v2)
The Map function is applied in parallel to every pair in the input dataset. This produces a list of pairs for each call. After that, the MapReduce framework collects all pairs with the same key from all lists and groups them together, thus creating one group for each one of the different generated keys.
The Reduce function is then applied in parallel to each group, which in turn produces a collection of values in the same domain:
Reduce(k2, list (v2))
→ list(v3)
Each Reduce call typically produces either one value v3 or an empty return, though one call is allowed to return more than one value. The returns of all calls are collected as the desired result list.
Thus the MapReduce framework transforms a list of (key, value) pairs into a list of values. This behavior is different from the typical functional programming map and reduce combination, which accepts a list of arbitrary values and returns one single value that combines all the values returned by map.
It is necessary but not sufficient to have implementations of the map and reduce abstractions in order to implement MapReduce. Distributed implementations of MapReduce require a means of connecting the processes performing the Map and Reduce phases. This may be a distributed file system. Other options are possible, such as direct streaming from mappers to reducers, or for the mapping processors to serve up their results to reducers that query them.
Read more about this topic: Map Reduce
Famous quotes containing the words logical and/or view:
“The logical English train a scholar as they train an engineer. Oxford is Greek factory, as Wilton mills weave carpet, and Sheffield grinds steel. They know the use of a tutor, as they know the use of a horse; and they draw the greatest amount of benefit from both. The reading men are kept by hard walking, hard riding, and measured eating and drinking, at the top of their condition, and two days before the examination, do not work but lounge, ride, or run, to be fresh on the college doomsday.”
—Ralph Waldo Emerson (18031882)
“Dont get involved in partial problems, but always take flight to where there is a free view over the whole single great problem, even if this view is still not a clear one.”
—Ludwig Wittgenstein (18891951)