use of org.apache.hyracks.dataflow.std.collectors.SortMergeFrameReader in project asterixdb by apache.
the class MToNPartitioningMergingConnectorDescriptor method createPartitionCollector.
@Override
public IPartitionCollector createPartitionCollector(IHyracksTaskContext ctx, RecordDescriptor recordDesc, int index, int nProducerPartitions, int nConsumerPartitions) throws HyracksDataException {
IBinaryComparator[] comparators = new IBinaryComparator[comparatorFactories.length];
for (int i = 0; i < comparatorFactories.length; ++i) {
comparators[i] = comparatorFactories[i].createBinaryComparator();
}
INormalizedKeyComputer nmkComputer = nkcFactory == null ? null : nkcFactory.createNormalizedKeyComputer();
IPartitionBatchManager pbm = new NonDeterministicPartitionBatchManager(nProducerPartitions);
IFrameReader sortMergeFrameReader = new SortMergeFrameReader(ctx, nProducerPartitions, nProducerPartitions, sortFields, comparators, nmkComputer, recordDesc, pbm);
BitSet expectedPartitions = new BitSet();
expectedPartitions.set(0, nProducerPartitions);
return new PartitionCollector(ctx, getConnectorId(), index, expectedPartitions, sortMergeFrameReader, pbm);
}
Aggregations