Вопрос

In the bottom example in this hadoop tutorial there is a "configure()" method. http://hadoop.apache.org/common/docs/r0.20.2/mapred_tutorial.html#Source+Code-N10FD0

I wanted to put a print statement within it to know that it arrives there. However, nothing prints to console. Am I doing it wrong or is there something to hadoop that I do not understand.

It is on line 28 of the example at the bottom of the page.

Here is what I put, but again only the normal output of WordCount was put to console.

public void configure(JobConf job) {
System.out.println("HERE !@#$%^&*");
caseSensitive = job.getBoolean("wordcount.case.sensitive", true);
inputFile = job.get("map.input.file");
Это было полезно?

Решение

When you say console - do you mean the console from which you submit the job from?

If you're running on local mode, then i would expect the sysout to be in the console.

If this job was run against a cluster (pseudo or real), then the sysout statement will go to the task logs, and will not come back to your local console (unless the task has an error, in which case you will probably see the stdout/err come back to the console). You can view these logs by going to the Job Tracker web UI, and then drill down on the job to display the map and reduce tasks - each task has logs associated with it, which you can view via the web ui too.

Другие советы

add this statement to your jobconf object. Ans : conf.set(“mapred.job.tracker”, “local”);

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top