Correct Answer : Get Lastest Questions and Answer : Explanation: The default run() method for the Mapper class invokes setup() once for each Mapper/split. The run() method then calls the map() method once for each record. You can override the default run() method if you wanted to do some debugging, or if you implement a multi-threaded Mapper. The setup() method is called when the task starts (i.e. before the map() method is called).
Question : Map the following A. setup() B. map() C. cleanup()
Correct Answer : Get Lastest Questions and Answer : Explanation: The default run() method for the Mapper class invokes setup() once for each Mapper/split. The run() method then calls the map() method once for each record. You can override the default run() method if you wanted to do some debugging, or if you implement a multi-threaded Mapper. The setup() method is called when the task starts (i.e. before the map() method is called).
Question : You have written a MapReduce job. You open a connection to HBASE and read data from it. Which is the write place to close HBase connection?
Correct Answer : Get Lastest Questions and Answer : Explanation: : The cleanup() method is called when the mapper task finishes . One use case for using the setup() and cleanup() method is to open and close a file, HBase, or JDBC connection. This is a much more streamlined approach if I/O is performed during the task than to open and close a stream within the map() or reduce() method.