READ Free Dumps For Cloudera- CCD-410
Question ID 12521 | Which process describes the lifecycle of a Mapper?
|
Option A | The JobTracker calls the TaskTrackers configure () method, then its map () method and finally its close () method.
|
Option B | The TaskTracker spawns a new Mapper to process all records in a single input split.
|
Option C | The TaskTracker spawns a new Mapper to process each key-value pair.
|
Option D | The JobTracker spawns a new Mapper to process all records in a single file.
|
Correct Answer | B |
Explanation Explanation: For each map instance that runs, the TaskTracker creates a new instance of your mapper. Note: * The Mapper is responsible for processing Key/Value pairs obtained from the InputFormat. The mapper may perform a number of Extraction and Transformation functions on the Key/Value pair before ultimately outputting none, one or many Key/Value pairs of the same, or different Key/Value type. * With the new Hadoop API, mappers extend the org.apache.hadoop.mapreduce.Mapper class. This class defines an 'Identity' map function by default - every input Key/Value pair obtained from the InputFormat is written out. Examining the run() method, we can see the lifecycle of the mapper: /** * Expert users can override this method for more complete control over the * execution of the Mapper. * @param context * @throws IOException */ public void run(Context context) throws IOException, InterruptedException { setup(context); while (context.nextKeyValue()) { map(context.getCurrentKey(), context.getCurrentValue(), context); } cleanup(context); } setup(Context) - Perform any setup for the mapper. The default implementation is a no-op method. map(Key, Value, Context) - Perform a map operation in the given Key / Value pair. The default implementation calls Context.write(Key, Value) cleanup(Context) - Perform any cleanup for the mapper. The default implementation is a no-op method. Reference: Hadoop/MapReduce/Mapper
Question ID 12522 | In the reducer, the MapReduce API provides you with an iterator over Writable values.
What does calling the next () method return?
|
Option A | It returns a reference to a different Writable object time.
|
Option B | It returns a reference to a Writable object from an object pool.
|
Option C | It returns a reference to the same Writable object each time, but populated with different data.
|
Option D | It returns a reference to a Writable object. The API leaves unspecified whether this is a reused object or a new object.
|
Option E | It returns a reference to the same Writable object if the next value is the same as the previous value, or a new Writable object otherwise.
|
Correct Answer | C |
Explanation Explanation: Calling Iterator.next() will always return the SAME EXACT instance of IntWritable, with the contents of that instance replaced with the next value. Reference: manupulating iterator in mapreduce