Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8279355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:18:34+00:00 2026-06-08T09:18:34+00:00

Can anyone help me out on how to print the key and the values

  • 0

Can anyone help me out on how to print the key and the values that is being used in the reducer code below

I tried to print out values via Logger as well as System.out, but we couldnt see the output on the logger as well as in the console.

 public static class IntSumReducer
       extends Reducer<Text,IntWritable,Text,IntWritable> {
    private IntWritable result = new IntWritable();
    //private static final Log LOG = LogFactory.getLog(WordCount.class);
    public void reduce(Text key, Iterable<IntWritable> values,
                       Context context
                       ) throws IOException, InterruptedException {
      int sum = 0;

      for (IntWritable val : values) {
        sum += val.get();
      //LOG.info("val = " + val.get());
      //System.out.println("val = " + val.get());
      }
      //System.out.println("sum = " + sum + " key = " + key);
      //LOG.info("sum = " + sum + " key = " + key);
      result.set(sum);
      context.write(key, result);
    }
  }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T09:18:38+00:00Added an answer on June 8, 2026 at 9:18 am

    System.out and LOG.info should both work – but you have to go and find the logs for the reduce attempt.

    You can find these in the Job Tracker Web UI (http://jobtracker:50030) – locate your job in the list of running, complete, failed or retired jobs, and click on the hyperlinked job ID. This will take you to a view of the Job run. From here you should be able to click on the reducers tasks (there will be a number for pending, running, complete, failed and killed – preferably click on one of the numbers for complete.

    Now you will have a list of completed reduce tasks – clicking on a particular task should then list the attempts for that task, and to the right of the table will be a link for the Logs (first 4k, last 4, all), where you should be able to find your output messages (assuming you remove the comments in front of your code above and run your job with the System.out or LOG.info allowed to execute)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone help me figure out whats wrong with this piece of xaml code?
Anyone that can help me out will be very much appreciated. I seem to
Can anyone help me? example A {1,2,3} B {1,4,5} Code snippet: a.intersect(b).print() // Result
Can anyone help out with what im doing wrong here? DEMO HTML <div id=usercurrentccbox>
Can anyone help me out please? I'm confused. I want to set up my
can anyone help me out with the syntax and example for the target server
I am new in Blackberry. Can anyone help me out for following queries? Which
I am new in Symbian UIQ. So anyone can help me out about following
Can anyone please help me to work out how to achieve the following? I
I have this weird bug that I cannot fix. Can anyone help me? Thank

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.