Search in sources :

Example 1 with TISSinkFactory

use of com.qlangtech.tis.plugin.incr.TISSinkFactory in project plugins by qlangtech.

the class CUDCDCTestSuit method createConsumerHandle.

protected IResultRows createConsumerHandle(String tabName) {
    TestBasicFlinkSourceHandle sourceHandle = new TestBasicFlinkSourceHandle(tabName);
    TISSinkFactory sinkFuncFactory = new TISSinkFactory() {

        @Override
        public Map<IDataxProcessor.TableAlias, SinkFunction<DTO>> createSinkFunction(IDataxProcessor dataxProcessor) {
            return Collections.emptyMap();
        }
    };
    sourceHandle.setSinkFuncFactory(sinkFuncFactory);
    return sourceHandle;
}
Also used : TISSinkFactory(com.qlangtech.tis.plugin.incr.TISSinkFactory) SinkFunction(org.apache.flink.streaming.api.functions.sink.SinkFunction) TestBasicFlinkSourceHandle(com.qlangtech.plugins.incr.flink.cdc.source.TestBasicFlinkSourceHandle) IDataxProcessor(com.qlangtech.tis.datax.IDataxProcessor)

Example 2 with TISSinkFactory

use of com.qlangtech.tis.plugin.incr.TISSinkFactory in project plugins by qlangtech.

the class DefaultDataxProcessor method writerPluginOverwrite.

private <T> T writerPluginOverwrite(Function<IStreamIncrGenerateStrategy, T> func) {
    TISSinkFactory sinKFactory = TISSinkFactory.getIncrSinKFactory(this.identityValue());
    Objects.requireNonNull(sinKFactory, "writer plugin can not be null");
    if (sinKFactory instanceof IStreamIncrGenerateStrategy) {
        return func.apply(((IStreamIncrGenerateStrategy) sinKFactory));
    }
    return func.apply(this);
}
Also used : TISSinkFactory(com.qlangtech.tis.plugin.incr.TISSinkFactory) IStreamIncrGenerateStrategy(com.qlangtech.tis.sql.parser.tuple.creator.IStreamIncrGenerateStrategy)

Aggregations

TISSinkFactory (com.qlangtech.tis.plugin.incr.TISSinkFactory)2 TestBasicFlinkSourceHandle (com.qlangtech.plugins.incr.flink.cdc.source.TestBasicFlinkSourceHandle)1 IDataxProcessor (com.qlangtech.tis.datax.IDataxProcessor)1 IStreamIncrGenerateStrategy (com.qlangtech.tis.sql.parser.tuple.creator.IStreamIncrGenerateStrategy)1 SinkFunction (org.apache.flink.streaming.api.functions.sink.SinkFunction)1