Search in sources :

Example 1 with GeneratedResultFutureWrapper

use of org.apache.flink.table.runtime.generated.GeneratedResultFutureWrapper in project flink by apache.

the class AsyncLookupJoinHarnessTest method createHarness.

// ---------------------------------------------------------------------------------
@SuppressWarnings({ "unchecked", "rawtypes" })
private OneInputStreamOperatorTestHarness<RowData, RowData> createHarness(JoinType joinType, FilterOnTable filterOnTable) throws Exception {
    RichAsyncFunction<RowData, RowData> joinRunner;
    boolean isLeftJoin = joinType == JoinType.LEFT_JOIN;
    if (filterOnTable == FilterOnTable.WITHOUT_FILTER) {
        joinRunner = new AsyncLookupJoinRunner(new GeneratedFunctionWrapper(new TestingFetcherFunction()), fetcherConverter, new GeneratedResultFutureWrapper<>(new TestingFetcherResultFuture()), rightRowSerializer, isLeftJoin, ASYNC_BUFFER_CAPACITY);
    } else {
        joinRunner = new AsyncLookupJoinWithCalcRunner(new GeneratedFunctionWrapper(new TestingFetcherFunction()), fetcherConverter, new GeneratedFunctionWrapper<>(new CalculateOnTemporalTable()), new GeneratedResultFutureWrapper<>(new TestingFetcherResultFuture()), rightRowSerializer, isLeftJoin, ASYNC_BUFFER_CAPACITY);
    }
    return new OneInputStreamOperatorTestHarness<>(new AsyncWaitOperatorFactory<>(joinRunner, ASYNC_TIMEOUT_MS, ASYNC_BUFFER_CAPACITY, AsyncDataStream.OutputMode.ORDERED), inSerializer);
}
Also used : AsyncLookupJoinRunner(org.apache.flink.table.runtime.operators.join.lookup.AsyncLookupJoinRunner) GenericRowData(org.apache.flink.table.data.GenericRowData) RowData(org.apache.flink.table.data.RowData) GeneratedFunctionWrapper(org.apache.flink.table.runtime.generated.GeneratedFunctionWrapper) GeneratedResultFutureWrapper(org.apache.flink.table.runtime.generated.GeneratedResultFutureWrapper) OneInputStreamOperatorTestHarness(org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness) AsyncLookupJoinWithCalcRunner(org.apache.flink.table.runtime.operators.join.lookup.AsyncLookupJoinWithCalcRunner)

Aggregations

OneInputStreamOperatorTestHarness (org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness)1 GenericRowData (org.apache.flink.table.data.GenericRowData)1 RowData (org.apache.flink.table.data.RowData)1 GeneratedFunctionWrapper (org.apache.flink.table.runtime.generated.GeneratedFunctionWrapper)1 GeneratedResultFutureWrapper (org.apache.flink.table.runtime.generated.GeneratedResultFutureWrapper)1 AsyncLookupJoinRunner (org.apache.flink.table.runtime.operators.join.lookup.AsyncLookupJoinRunner)1 AsyncLookupJoinWithCalcRunner (org.apache.flink.table.runtime.operators.join.lookup.AsyncLookupJoinWithCalcRunner)1