public void reduce(Text key,Iterator<LinkNode> values,OutputCollector<Text,LinkNodes> output,Reporter reporter) throws IOException {
  List<LinkNode> nodeList=new ArrayList<LinkNode>();
  int numNodes=0;
  while (values.hasNext()) {
    LinkNode cur=values.next();
    if (numNodes < maxInlinks) {
      nodeList.add((LinkNode)WritableUtils.clone(cur,conf));
      numNodes++;
    }
 else {
      break;
    }
  }
  LinkNode[] linkNodesAr=nodeList.toArray(new LinkNode[nodeList.size()]);
  LinkNodes linkNodes=new LinkNodes(linkNodesAr);
  output.collect(key,linkNodes);
}

public void reduce ( Text key , Iterator < LinkNode > values , OutputCollector < Text , LinkNodes > output , Reporter reporter ) throws IOException { List < LinkNode > nodeList = new ArrayList < LinkNode > ( ) ; int numNodes = 0 ; while ( values . hasNext ( ) ) { LinkNode cur = values . next ( ) ; if ( numNodes < maxInlinks ) { nodeList . add ( ( LinkNode ) WritableUtils . clone ( cur , conf ) ) ; numNodes ++ ; } else { break ; } } LinkNode [ ] linkNodesAr = nodeList . toArray ( new LinkNode [ nodeList . size ( ) ] ) ; LinkNodes linkNodes = new LinkNodes ( linkNodesAr ) ; output . collect ( key , linkNodes ) ; }
aggregate all linknode objects for a given url .
