hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alberto Andreotti <albertoandreo...@gmail.com>
Subject Re: Deserializing a MapWritable entry set.
Date Tue, 21 Jun 2011 20:18:40 GMT
Never worked with maps before, btw what are you trying to calculate?


alberto.

On 21 June 2011 17:14, Dhruv Kumar <dkumar@ecs.umass.edu> wrote:

> I want to extract the key-value pairs from a MapWritable, cast them into
> Integer (key) and Double (value) types, and add them to another collection.
> I'm attempting the following but this code is incorrect.
>
> // initialDistributionStripe is a MapWritable<IntWritable, DoubleWritable>
> // initialProbabilities is of type  Vector which can have (Integer, Double)
> entries in it
>
> for (Map.Entry<Writable, Writable> entry : initialDistributionStripe.
> entrySet()) {
>      initialProbabilities.set(entry.getKey(), entry.getValue());
>    }
>
>
> Is there a convenient way to do this?
>



-- 
José Pablo Alberto Andreotti.
Tel: 54 351 4730292
Móvil: 54351156526363.
MSN: albertoandreotti@gmail.com
Skype: andreottialberto

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