use of org.apache.hyracks.dataflow.std.group.preclustered.PreclusteredGroupWriter in project asterixdb by apache.
the class MicroPreClusteredGroupRuntimeFactory method createOneOutputPushRuntime.
@Override
public AbstractOneInputOneOutputPushRuntime createOneOutputPushRuntime(final IHyracksTaskContext ctx) throws HyracksDataException {
final IBinaryComparator[] comparators = new IBinaryComparator[comparatorFactories.length];
for (int i = 0; i < comparatorFactories.length; ++i) {
comparators[i] = comparatorFactories[i].createBinaryComparator();
}
return new AbstractOneInputOneOutputPushRuntime() {
private PreclusteredGroupWriter pgw;
@Override
public void open() throws HyracksDataException {
pgw = new PreclusteredGroupWriter(ctx, groupFields, comparators, aggregatorFactory, inRecordDesc, outRecordDesc, writer);
pgw.open();
}
@Override
public void nextFrame(ByteBuffer buffer) throws HyracksDataException {
pgw.nextFrame(buffer);
}
@Override
public void fail() throws HyracksDataException {
pgw.fail();
}
@Override
public void close() throws HyracksDataException {
pgw.close();
}
@Override
public void flush() throws HyracksDataException {
pgw.flush();
}
};
}
use of org.apache.hyracks.dataflow.std.group.preclustered.PreclusteredGroupWriter in project asterixdb by apache.
the class ExternalSortGroupByRunMerger method prepareIntermediateMergeResultWriter.
@Override
protected IFrameWriter prepareIntermediateMergeResultWriter(RunFileWriter mergeFileWriter) throws HyracksDataException {
IAggregatorDescriptorFactory aggregatorFactory = localSide ? mergeAggregatorFactory : partialAggregatorFactory;
boolean outputPartial = true;
return new PreclusteredGroupWriter(ctx, mergeGroupFields, groupByComparators, aggregatorFactory, partialAggRecordDesc, partialAggRecordDesc, mergeFileWriter, outputPartial);
}
use of org.apache.hyracks.dataflow.std.group.preclustered.PreclusteredGroupWriter in project asterixdb by apache.
the class ExternalSortGroupByRunMerger method prepareSkipMergingFinalResultWriter.
@Override
protected IFrameWriter prepareSkipMergingFinalResultWriter(IFrameWriter nextWriter) throws HyracksDataException {
IAggregatorDescriptorFactory aggregatorFactory = localSide ? partialAggregatorFactory : mergeAggregatorFactory;
boolean outputPartial = false;
return new PreclusteredGroupWriter(ctx, groupFields, groupByComparators, aggregatorFactory, inputRecordDesc, outRecordDesc, nextWriter, outputPartial);
}
Aggregations