use of org.apache.hyracks.dataflow.std.sort.util.GroupFrameAccessor in project asterixdb by apache.
the class AbstractRunGeneratorTest method matchResult.
static void matchResult(IHyracksTaskContext ctx, List<GeneratedRunFileReader> runs, Map<Integer, String> keyValuePair) throws HyracksDataException {
HashMap<Integer, String> copyMap2 = new HashMap<>(keyValuePair);
int maxFrameSizes = 0;
for (GeneratedRunFileReader run : runs) {
maxFrameSizes = Math.max(maxFrameSizes, run.getMaxFrameSize());
}
GroupVSizeFrame gframe = new GroupVSizeFrame(ctx, maxFrameSizes);
GroupFrameAccessor gfta = new GroupFrameAccessor(ctx.getInitialFrameSize(), RecordDesc);
assertReadSorted(runs, gfta, gframe, copyMap2);
}
use of org.apache.hyracks.dataflow.std.sort.util.GroupFrameAccessor in project asterixdb by apache.
the class RunMergingFrameReader method open.
@Override
public void open() throws HyracksDataException {
tupleCount = 0;
tupleAccessors = new IFrameTupleAccessor[runCursors.size()];
outFrameAppender = new FrameTupleAppender();
Comparator<ReferenceEntry> comparator = createEntryComparator(comparators);
topTuples = new ReferencedPriorityQueue(runCursors.size(), comparator, sortFields, nmkComputer);
tupleIndexes = new int[runCursors.size()];
for (int i = 0; i < runCursors.size(); i++) {
tupleIndexes[i] = 0;
int runIndex = topTuples.peek().getRunid();
runCursors.get(runIndex).open();
if (runCursors.get(runIndex).nextFrame(inFrames.get(runIndex))) {
tupleAccessors[runIndex] = new GroupFrameAccessor(ctx.getInitialFrameSize(), recordDesc);
tupleAccessors[runIndex].reset(inFrames.get(runIndex).getBuffer());
setNextTopTuple(runIndex, tupleIndexes, runCursors, inFrames, tupleAccessors, topTuples);
} else {
closeRun(runIndex, runCursors, tupleAccessors);
topTuples.pop();
}
}
}
Aggregations