Manages the different instances of the application, like the Scheduler, the PluginManager, the PullManager, GraphManager; Listens for events from these instances and executes the correct actions for those events, this way the components behind Mapper don't need to know about the others, so it should be easy for anyone to change any of those classes without affecting the entire solution.
The most dependent instance that goes beyond Mapper is GraphManager, because it has some important objects you want to access from MapApplet like the VisualizationViewer, because of that you have access to VisualizationViewer, locate a host, clear the selected hosts, and some other GraphManager methods, but you don't have direct access to it.
If you want from MapApplet to execute an action in PullManager you could access PullManager directly using the getPullManager function, this might change in the future. (sorry kinda lack of time to do this the right way)
@author Sergio Guzmán LorzA typical Container may be associated with a single Mapper that processes all requests to that Container, or a Mapper per request protocol that allows the same Container to support multiple protocols at once. @author Craig R. McClanahan @version $Revision: 466595 $ $Date: 2006-10-21 23:24:41 +0100 (Sat, 21 Oct 2006) $
Applications may write a custom {@link MapRunnable} to exert greatercontrol on map processing e.g. multi-threaded Mapper
s etc.
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 {@link InputSplit} generated by the {@link InputFormat} for the job.Mapper
implementations can access the {@link Configuration} for the job via the {@link JobContext#getConfiguration()}.
The framework first calls {@link #setup(org.apache.hadoop.mapreduce.Mapper.Context)}, followed by {@link #map(Object,Object,Context)} for each key/value pair in the InputSplit
. Finally {@link #cleanup(Context)} is called.
All intermediate values associated with a given output key are subsequently grouped by the framework, and passed to a {@link Reducer} to determine the final output. Users can control the sorting and grouping by specifying two key {@link RawComparator} classes.
The Mapper
outputs are partitioned per Reducer
. Users can control which keys (and hence records) go to which Reducer
by implementing a custom {@link Partitioner}.
Users can optionally specify a combiner
, via {@link Job#setCombinerClass(Class)}, to perform local aggregation of the intermediate outputs, which helps to cut down the amount of data transferred from the Mapper
to the Reducer
.
Applications can specify if and how the intermediate outputs are to be compressed and which {@link CompressionCodec}s are to be used via the Configuration
.
If the job has zero reduces then the output of the Mapper
is directly written to the {@link OutputFormat} without sorting by keys.
Example:
public class TokenCounterMapper extends Mapper
Applications may override the {@link #run(Context)} method to exert greater control on map processing e.g. multi-threaded Mapper
s etc.
<person> <firstName>Jason</firstName> <lastName>van Zyl</lastName> <hobbies> <hobby>somnambulism</hobby> <hobby>squash</hobby> </hobbies> <address> <street>50 King</street> <city>Guelph</city> <country>Canada</country> </address> </person>
These are some of the assumptions employed to make mapping the object simpler:
Does Element refers to a noun plural? Yes: treewalk No: Does the Element have children? Yes: Create object and attach to parent, have to look for inclusion rules as we might need to create an object from another XML file. Is the parent Element a plural noun? Yes: We have a collection: addX(x) is executed No: We have a simple property: setProperty(x) is executed No: Is there an inclusion rule? Yes: Create object from an XML file and attach No: Simple String value to attach
This class is not thread safe. @author Jason van Zyl @author Daniel Rall @version $Id: Mapper.java,v 1.17 2002/02/28 23:22:10 jvanzyl Exp $
This is the heart of Morphia and takes care of mapping from/to POJOs/DBObjects
This class is thread-safe and keeps various "cached" data which should speed up processing.
@author Olafur Gauti Gudmundsson @author Scott Hernandez Initial Date: 10.06.2005
@author Felix Jost
Execution of method map occurs in a certain environment (eg. a Map) that is made of a global environment provided by the manager this mapper is part of (see fr.norsys.mapper.manager.Manage and fr.norsys.mapper.manager.Configure) and by a local environment that is passed as the second parameter of method map. The base contract is that variables defined in the local environment have precedence over values defined in the global environment.
It is a resposibility of the map implementor to ensure this contract is enforced with each call to method map.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|