Search in sources :

Example 1 with PartitionedOutputOperatorFactory

use of io.prestosql.operator.PartitionedOutputOperator.PartitionedOutputOperatorFactory in project hetu-core by openlookeng.

the class TestPartitionedOutputOperatorFactory method testDuplicate.

@Test
public void testDuplicate() {
    OutputBuffer outputBuffer = mock(OutputBuffer.class);
    PartitionedOutputOperatorFactory factory1 = new PartitionedOutputOperatorFactory(1, new PlanNodeId("planNodeId"), Collections.emptyList(), a -> a, mock(PartitionFunction.class), Collections.emptyList(), Collections.emptyList(), false, OptionalInt.empty(), outputBuffer, DataSize.succinctBytes(1));
    OperatorFactory factory2 = factory1.duplicate();
    OperatorFactory factory3 = factory1.duplicate();
    OperatorFactory factory4 = factory2.duplicate();
    factory1.noMoreOperators();
    factory3.noMoreOperators();
    factory4.noMoreOperators();
    verify(outputBuffer, never()).setNoMoreInputChannels();
    factory2.noMoreOperators();
    verify(outputBuffer).setNoMoreInputChannels();
}
Also used : PlanNodeId(io.prestosql.spi.plan.PlanNodeId) PartitionedOutputOperatorFactory(io.prestosql.operator.PartitionedOutputOperator.PartitionedOutputOperatorFactory) OutputBuffer(io.prestosql.execution.buffer.OutputBuffer) PartitionedOutputOperatorFactory(io.prestosql.operator.PartitionedOutputOperator.PartitionedOutputOperatorFactory) Test(org.testng.annotations.Test)

Aggregations

OutputBuffer (io.prestosql.execution.buffer.OutputBuffer)1 PartitionedOutputOperatorFactory (io.prestosql.operator.PartitionedOutputOperator.PartitionedOutputOperatorFactory)1 PlanNodeId (io.prestosql.spi.plan.PlanNodeId)1 Test (org.testng.annotations.Test)1