What is the activeList ? a local variable or class member variable?
On Wed, Dec 23, 2009 at 6:30 AM, oo famcr <[email protected]> wrote: > Hello everyone > I want to save the value to a LinkedList, but THE ***activeList.get(0)*** > have been changed every time. > I think it should be the first element, but it's not. > > Thanks > Song > > ==========Part of WordCount=========== > public static class IntSumReducer > extends Reducer<Text,Text,Text,Text> { > private List<Text> activeList = new LinkedList<Text>(); > public void reduce(Text key, Iterable<Text> values, > Context context > ) throws IOException, InterruptedException { > for (Text val : values) { > activeList.add(val); > context.write(key, new Text( activeList.get(0).toString() )); > } > } >
