Search in sources :

Example 1 with HybridTopKSortRunGenerator

use of org.apache.hyracks.dataflow.std.sort.HybridTopKSortRunGenerator 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);
}
Also used : IHyracksTaskContext(org.apache.hyracks.api.context.IHyracksTaskContext) AbstractSortRunGenerator(org.apache.hyracks.dataflow.std.sort.AbstractSortRunGenerator) HybridTopKSortRunGenerator(org.apache.hyracks.dataflow.std.sort.HybridTopKSortRunGenerator) Test(org.junit.Test)

Example 2 with HybridTopKSortRunGenerator

use of org.apache.hyracks.dataflow.std.sort.HybridTopKSortRunGenerator 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);
}
Also used : IHyracksTaskContext(org.apache.hyracks.api.context.IHyracksTaskContext) AbstractSortRunGenerator(org.apache.hyracks.dataflow.std.sort.AbstractSortRunGenerator) HybridTopKSortRunGenerator(org.apache.hyracks.dataflow.std.sort.HybridTopKSortRunGenerator) Test(org.junit.Test)

Aggregations

IHyracksTaskContext (org.apache.hyracks.api.context.IHyracksTaskContext)2 AbstractSortRunGenerator (org.apache.hyracks.dataflow.std.sort.AbstractSortRunGenerator)2 HybridTopKSortRunGenerator (org.apache.hyracks.dataflow.std.sort.HybridTopKSortRunGenerator)2 Test (org.junit.Test)2