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 8426747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:36:49+00:00 2026-06-10T04:36:49+00:00

How can I send a specific record to all my reducers ? I know

  • 0

How can I send a specific record to all my reducers ?

I know the Partitioner class and what it does, but I don’t see any easy way of making sure a record goes to all the reducers.

Basically, the Partitioner has this method:

 int getPartition(K2 key,
             V2 value,
             int numPartitions)

My first idea was to have the Partitioner and the Mapper collaborate as follows: the Mapper keeps outputting the record a number of times equal to the number of reduce tasks and the Partitioner returns all the ints (from 0 to numPartitions-1) , this way being sure the record reaches all the partitions.

Are there any other, smarter ways of solving this ? For instance I return -1 for the records that I need sent to all partitions and the framework does that for me when it sees the returned -1.

  • 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-10T04:36:50+00:00Added an answer on June 10, 2026 at 4:36 am

    The partitioner doesn’t work that way. Its job is to look at the key (usually) and the value (rarely) to determine which reducer the pair should be sent to. This happens after the mapper and before the reducer.

    Instead, you (the mapper) should be able to ask the context for the configuration which can answer the total number of reducers (partitions). Your mapper can then output a complex key comprising the actual key you want and a partition number. You know how many times to write this out because the mapper can find out the number of reducers (see above). All the partitioner has to do is breakdown the composite key value, extract the target reducer index and return that index.

    By the way, this means that if you’re using this technique to send out counts (if you’re sorting) or other metadata to be used later in the processing then your real data keys have to follow the same composite format. In fact, you’ll probably have to include in the composite key an indicator describing the kind of key/value pair it is (e.g. 1=real data, 0=processing metadata).

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

Sidebar

Related Questions

I know that soap can send XML over http, is there any way to
how i can send sms from asp.net?any idea about it?or any resource through which
Is there any way I can send an email, like any frameworks or something.
I have a program that can send text to any other program for further
How can I send some specific number of, say 1000, messages (echo) per second
Does any one know what are the possible APNS providers around? I need to
I want to know how I can send or recieve data over internet to/from
I've started a project on Andorid, but I don't know NDK very much. I
I can send requests to friends using Multi Friend Request Selector inside my Page
How this UIButton rewind can send notification to UIButton play to perform playpauseaction method

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.