private void accumulateData() throws ExecException {
int size = inputs.size();
its = new Iterator[size];
data = new Tuple[size];
for(int i = 0; i < size; i++) {
DataBag bag = new SortedDataBag(new groupComparator());
for(Result input = inputs.get(i).getNext(dummyTuple); input.returnStatus != POStatus.STATUS_EOP; input = inputs.get(i).getNext(dummyTuple)) {
if(input.returnStatus == POStatus.STATUS_ERR) {
throw new ExecException("Error accumulating output at local Cogroup operator");
}
if(input.returnStatus == POStatus.STATUS_NULL)
continue;
bag.add((Tuple) input.result);
}
its[i] = bag.iterator();
data[i] = its[i].next();
}
}