for (int i = 0; i < inputs.length; i++) {
final int finalI = i;
sortedInputs[i] = new ArrayList<Datum[]>();
DataCollector outputFromSpec = new DataCollector(null){
@Override
public void add(Datum d) {
sortedInputs[finalI].add(LOCogroup.getGroupAndTuple(d));
}
};
DataCollector inputToSpec = specs.get(i).setupPipe(null,
outputFromSpec);
if(lineageTracer != null) specs.get(i).setLineageTracer(lineageTracer);
Tuple t;
while ((t = (Tuple) ((PhysicalOperator)opTable.get(inputs[i])).getNext()) != null) {
inputToSpec.add(t);
}
inputToSpec.finishPipe();
Collections.sort(sortedInputs[i], new Comparator<Datum[]>() {
public int compare(Datum[] a, Datum[] b) {
return a[0].compareTo(b[0]);
}