hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian MacKay" <Brian.Mac...@MEDecision.com>
Subject Set the Order of the Keys in Reduce
Date Thu, 22 Jan 2009 15:25:28 GMT
Hello,

 

Any tips would be greatly appreciated.

 

Is there a way to set the order of the keys in reduce as shown below, no
matter what order the collection in MAP occurs in.

 

Thanks, Brian

 

 

    public void map(WritableComparable key, Text values,

            OutputCollector<Text, Text> output, Reporter reporter)
throws IOException {

 

                        //collect many CAT_A and CAT_B in random order

                        output.collect(CAT_A, details);

                        output.collect(CAT_B, details);

 

     }

 

 

 

   public void reduce(Text key, Iterator<Text> values,

                    OutputCollector<Text, Text> output, Reporter
reporter) throws IOException {

 

            //always reduce CAT_A first, then reduce CAT_B

 

  }

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

The information transmitted is intended only for the person or entity to 
which it is addressed and may contain confidential and/or privileged 
material. Any review, retransmission, dissemination or other use of, or 
taking of any action in reliance upon, this information by persons or 
entities other than the intended recipient is prohibited. If you received 
this message in error, please contact the sender and delete the material 
from any computer.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message