use of org.apache.flink.table.runtime.generated.GeneratedFunctionWrapper 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);
}
use of org.apache.flink.table.runtime.generated.GeneratedFunctionWrapper in project flink by apache.
the class AsyncLookupJoinHarnessTest method testCloseAsyncLookupJoinRunner.
@Test
public void testCloseAsyncLookupJoinRunner() throws Exception {
final AsyncLookupJoinRunner joinRunner = new AsyncLookupJoinRunner(new GeneratedFunctionWrapper(new TestingFetcherFunction()), fetcherConverter, new GeneratedResultFutureWrapper<>(new TestingFetcherResultFuture()), rightRowSerializer, true, 100);
assertNull(joinRunner.getAllResultFutures());
closeAsyncLookupJoinRunner(joinRunner);
joinRunner.setRuntimeContext(new MockStreamingRuntimeContext(false, 1, 0));
joinRunner.open(new Configuration());
assertNotNull(joinRunner.getAllResultFutures());
closeAsyncLookupJoinRunner(joinRunner);
joinRunner.open(new Configuration());
joinRunner.asyncInvoke(row(1, "a"), new TestingFetcherResultFuture());
assertNotNull(joinRunner.getAllResultFutures());
closeAsyncLookupJoinRunner(joinRunner);
}
use of org.apache.flink.table.runtime.generated.GeneratedFunctionWrapper in project flink by apache.
the class LookupJoinHarnessTest method createHarness.
// ---------------------------------------------------------------------------------
@SuppressWarnings("unchecked")
private OneInputStreamOperatorTestHarness<RowData, RowData> createHarness(JoinType joinType, FilterOnTable filterOnTable) throws Exception {
boolean isLeftJoin = joinType == JoinType.LEFT_JOIN;
ProcessFunction<RowData, RowData> joinRunner;
if (filterOnTable == FilterOnTable.WITHOUT_FILTER) {
joinRunner = new LookupJoinRunner(new GeneratedFunctionWrapper<>(new TestingFetcherFunction()), new GeneratedCollectorWrapper<>(new TestingFetcherCollector()), isLeftJoin, 2);
} else {
joinRunner = new LookupJoinWithCalcRunner(new GeneratedFunctionWrapper<>(new TestingFetcherFunction()), new GeneratedFunctionWrapper<>(new CalculateOnTemporalTable()), new GeneratedCollectorWrapper<>(new TestingFetcherCollector()), isLeftJoin, 2);
}
ProcessOperator<RowData, RowData> operator = new ProcessOperator<>(joinRunner);
return new OneInputStreamOperatorTestHarness<>(operator, inSerializer);
}
Aggregations