use of org.apache.hyracks.dataflow.std.sort.AbstractSortRunGenerator in project asterixdb by apache.
the class TopKRunGeneratorTest method testHybridTopKShouldSwitchToFrameSorterWhenFlushed.
@Test
public void testHybridTopKShouldSwitchToFrameSorterWhenFlushed() {
int topK = 1;
IHyracksTaskContext ctx = AbstractRunGeneratorTest.testUtils.create(PAGE_SIZE);
AbstractSortRunGenerator sorter = new HybridTopKSortRunGenerator(ctx, SORT_FRAME_LIMIT, topK, SortFields, null, ComparatorFactories, RecordDesc);
}
use of org.apache.hyracks.dataflow.std.sort.AbstractSortRunGenerator in project asterixdb by apache.
the class TopKRunGeneratorTest method testHybridTopKShouldNotGenerateAnyRuns.
@Test
public void testHybridTopKShouldNotGenerateAnyRuns() throws HyracksDataException {
int topK = 1;
IHyracksTaskContext ctx = AbstractRunGeneratorTest.testUtils.create(PAGE_SIZE);
AbstractSortRunGenerator sorter = new HybridTopKSortRunGenerator(ctx, SORT_FRAME_LIMIT, topK, SortFields, null, ComparatorFactories, RecordDesc);
testInMemoryOnly(ctx, topK, ORDER.REVERSE, sorter);
}
use of org.apache.hyracks.dataflow.std.sort.AbstractSortRunGenerator in project asterixdb by apache.
the class AbstractRunGeneratorTest method testSortRecords.
protected List<GeneratedRunFileReader> testSortRecords(int pageSize, int frameLimit, int numRuns, int minRecordSize, int maxRecordSize, HashMap<Integer, String> specialData) throws HyracksDataException {
IHyracksTaskContext ctx = testUtils.create(pageSize);
HashMap<Integer, String> keyValuePair = new HashMap<>();
List<IFrame> frameList = new ArrayList<>();
prepareData(ctx, frameList, pageSize * frameLimit * numRuns, minRecordSize, maxRecordSize, specialData, keyValuePair);
AbstractSortRunGenerator runGenerator = getSortRunGenerator(ctx, frameLimit, keyValuePair.size());
runGenerator.open();
for (IFrame frame : frameList) {
runGenerator.nextFrame(frame.getBuffer());
}
runGenerator.close();
matchResult(ctx, runGenerator.getRuns(), keyValuePair);
return runGenerator.getRuns();
}
Aggregations