Premium

Mapr (HP) Hadoop Developer Certification Questions and Answers (Dumps and Practice Questions)



Question : In the regular WordCount MapReduce example, you have following driver code.
public class WordCount extends Configured implements Tool {
public static void main(String args[]) throws Exception {
int res = ToolRunner.run(new WordCount(), args);
System.exit(res);
}
public int run(String[] args) throws Exception {
Path inputPath = new Path("shakespeare1");
Path outputPath = new Path(""+System.currentTimeMillis());
Configuration conf = getConf();
Job job = new Job(conf, this.getClass().toString());
FileInputFormat.setInputPaths(job, inputPath);
FileOutputFormat.setOutputPath(job, outputPath);
job.setJobName("WordCount"); job.setJarByClass(WordCount.class); job.setJarByClass(WordCount.class);
job.setJobName("Word Count");
job.setMapperClass(WordMapper.class); job.setReducerClass(SumReducer.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
job.setNumReduceTasks(2);
return job.waitForCompletion(true) ? 0 : 1;
} }
Now you run the below command on a single node cluste. Where wc.jar is jar file containing Driver,Mapper and Reducer class.
hadoop jar wc.jar WordCount -D mapred.reduce.tasks=3
Select the correct statement from below.
  : In the regular WordCount MapReduce example, you have following driver code.
1. It will run 3 Reducer as command line option would be preferred
2. It will run 2 reducers as driver code has defined number of reducer
3. Access Mostly Uused Products by 50000+ Subscribers
4. Number of reducer can not be determined command line and driver configuration is just a hint

Correct Answer : Get Lastest Questions and Answer : Following are the priorities of the 3 options for setting number of reduces
Option1: setNumReduceTasks(2) within the application code
Option2: -D mapreduce.job.reduces=2 as command line argument
Option3: through $HADOOP_CONF_DIR/mapred-site.xml file

property : name mapreduce.job.reduces
value : 2
Above racked in priority order - option 1 will override 2, and 2 will override 3. In other words Option 1 will be the one used by your job in this scenario.





Question : You are running the regular WordCount example with the Mapper and Reducer defined in a separate class. Now you have files
in a directory from which you want to count number of words.
Out of these 4 files, 3 files has 1 line in each file and 4th file has 0 lines.
Now you run the wordcount job, then how many Mapper will be executed (Assuming you are running on a single node)?


  : You are running the regular WordCount example with the Mapper and Reducer defined in a separate class. Now you have  files
1. Only 1 Mapper as it is a single node cluster
2. 3 Mapper, only for the files which has the data
3. Access Mostly Uused Products by 50000+ Subscribers
4. Number of Mapper is non-deterministic

Correct Answer : Get Lastest Questions and Answer :

Explanation: If a file size is a less than block size (64MB), then for each file one Mapper will be executed. It does not matter whether file size is zero.




Question : Please select the correct features for the HDFS
  : Please select the correct features for the HDFS
1. Files in HDFS can concurrently updated and read
2. Files in HDFS can concurrently updated
3. Access Mostly Uused Products by 50000+ Subscribers
4. Files in HDFS cannot be concurrently read

Correct Answer : Get Lastest Questions and Answer :

Explanation: An application adds data to HDFS by creating a new file and writing the data to it. After the file is closed, the bytes written cannot be altered or removed except that new
data can be added to the file by reopening the file for append. HDFS implements a single-writer, multiple-reader model.
The HDFS client that opens a file for writing is granted a lease for the file; no other client can write to the file. The writing client periodically renews the lease by sending a
heartbeat to the NameNode. When the file is closed, the lease is revoked. The lease duration is bound by a soft limit and a hard limit. Until the soft limit expires, the writer is
certain of exclusive access to the file. If the soft limit expires and the client fails to close the file or renew the lease, another client can preempt the lease. If after the hard
limit expires (one hour) and the client has failed to renew the lease, HDFS assumes that the client has quit and will automatically close the file on behalf of the writer, and
recover the lease. The writer's lease does not prevent other clients from reading the file; a file may have many concurrent readers.



Related Questions


Question : Select the correct flow by which MapReduce job process the data in MRv.

  : Select the correct flow by which MapReduce job process the data in MRv.
1. Input File > Mapper > Combiner (Optional) > shuffle > reducer >output file

2. Mapper > Input File > Combiner (Optional) > shuffle > reducer >output file

3. Input File > Mapper > shuffle > Combiner (Optional) > reducer >output file

4. Input File > Mapper > shuffle > reducer > Combiner (Optional) >output file


Question : If you have written a Mapper which has both Input key and Value as Text. Which of the following component you will us eto break entire text in the Individual fields.

  : If you have written a Mapper which has both Input key and Value as Text. Which  of the following component you will us eto break entire text in the Individual fields.
1. NameNode

2. TaskTracker

3. Application Master

4. StringTokenizer


Question : As you have following map() function of the Mapper

public void map(Text text, Text value, Content cnt) throws ....
cnt.write(new Text("Hadoop"), new Text("Exam"));

Whar is the new Text("Hadoop")


  : As you have following map() function of the Mapper
1. Key

2. Value

3. Represent to use MRv1 framework

4. Represent to use MRv2 framework


Question : In MRv Driver class , a new Job object is created, What else is true for Driver class ?

  :  In MRv Driver class , a new Job object is created, What else is true for Driver class ?
1. Always use ToolRunner class

2. Always provide the input file

3. It checks the command line syntex

4. Also sets values for the driver, mapper, and reducer classes used.


Question : What are the TWO main components of the YARN ResourceManager process? Choose answers
A. Job Tracker
B. Task Tracker
C. Scheduler
D. Applications Manager
  : What are the TWO main components of the YARN ResourceManager process? Choose  answers
1. A,B
2. B,C
3. C,D
4. A,D
5. B,D


Question : Given a directory of files with the following structure: line number, tab character, string:
Example:
1abialkjfjkaoasdfjksdlkjhqweroij
2kadfjhuwqounahagtnbvaswslmnbfgy
3kjfteiomndscxeqalkzhtopedkfsikj
You want to send each line as one record to your Mapper. Which InputFormat should you
use to complete the line: conf.setInputFormat (____.class) ; ?

  : Given a directory of files with the following structure: line number, tab character, string:
1. SequenceFileAsTextInputFormat
2. SequenceFileInputFormat
3. KeyValueFileInputFormat
4. BDBInputFormat