use of com.qlangtech.tis.sql.parser.tuple.creator.IStreamIncrGenerateStrategy 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);
}
use of com.qlangtech.tis.sql.parser.tuple.creator.IStreamIncrGenerateStrategy in project tis by qlangtech.
the class TestStreamComponentCodeGenerator method testGeneratorSearch4totalpay5Code.
public void testGeneratorSearch4totalpay5Code() throws Exception {
long timestamp = 20200928183209l;
IStreamIncrGenerateStrategy streamIncrGenerateStrategy = EasyMock.createMock("streamIncrGenerateStrategy", IStreamIncrGenerateStrategy.class);
String collectionName = "search4totalpay5";
SqlTaskNodeMeta.SqlDataFlowTopology topology = SqlTaskNodeMeta.getSqlDataFlowTopology("totalpay2");
FacadeContext fc = new FacadeContext();
fc.setFacadeInstanceName("order2DAOFacade");
fc.setFullFacadeClassName("com.qlangtech.tis.realtime.order.dao.IOrder2DAOFacade");
fc.setFacadeInterfaceName("IOrder2DAOFacade");
List<FacadeContext> facadeList = Lists.newArrayList();
facadeList.add(fc);
StreamComponentCodeGenerator streamCodeGenerator = new StreamComponentCodeGenerator(collectionName, timestamp, facadeList, streamIncrGenerateStrategy);
EasyMock.replay(streamIncrGenerateStrategy);
streamCodeGenerator.build();
assertGenerateContentEqual(timestamp, collectionName, "S4totalpay5Listener.scala");
EasyMock.verify(streamIncrGenerateStrategy);
}
use of com.qlangtech.tis.sql.parser.tuple.creator.IStreamIncrGenerateStrategy in project tis by qlangtech.
the class TestTikvEmployee method testGeneratorCode.
public void testGeneratorCode() throws Exception {
long timestamp = 20201111115959l;
String collectionName = "search4employees";
IStreamIncrGenerateStrategy streamIncrGenerateStrategy = EasyMock.createMock("streamIncrGenerateStrategy", IStreamIncrGenerateStrategy.class);
String dfName = "tikv-employee";
SqlTaskNodeMeta.SqlDataFlowTopology topology = SqlTaskNodeMeta.getSqlDataFlowTopology(dfName);
FacadeContext fc = new FacadeContext();
fc.setFacadeInstanceName("employeesDAOFacade");
fc.setFullFacadeClassName("com.qlangtech.tis.realtime.employees.dao.IEmployeesDAOFacade");
fc.setFacadeInterfaceName("IEmployeesDAOFacade");
List<FacadeContext> facadeList = Lists.newArrayList();
facadeList.add(fc);
StreamComponentCodeGenerator streamCodeGenerator = new StreamComponentCodeGenerator(collectionName, timestamp, facadeList, streamIncrGenerateStrategy);
EasyMock.replay(streamIncrGenerateStrategy);
streamCodeGenerator.build();
TestStreamComponentCodeGenerator.assertGenerateContentEqual(timestamp, collectionName, "S4employeesListener.scala");
EasyMock.verify(streamIncrGenerateStrategy);
}
use of com.qlangtech.tis.sql.parser.tuple.creator.IStreamIncrGenerateStrategy in project tis by qlangtech.
the class TestStreamComponentCodeGenerator method testGeneratorCode.
public void testGeneratorCode() throws Exception {
long timestamp = 20191111115959l;
String collectionName = "search4totalpay";
SqlTaskNodeMeta.SqlDataFlowTopology topology = SqlTaskNodeMeta.getSqlDataFlowTopology("totalpay");
assertNotNull(topology);
IStreamIncrGenerateStrategy streamIncrGenerateStrategy = EasyMock.createMock("streamIncrGenerateStrategy", IStreamIncrGenerateStrategy.class);
FacadeContext fc = new FacadeContext();
fc.setFacadeInstanceName("order2DAOFacade");
fc.setFullFacadeClassName("com.qlangtech.tis.realtime.order.dao.IOrder2DAOFacade");
fc.setFacadeInterfaceName("IOrder2DAOFacade");
List<FacadeContext> facadeList = Lists.newArrayList();
facadeList.add(fc);
StreamComponentCodeGenerator streamCodeGenerator = new StreamComponentCodeGenerator("search4totalpay", timestamp, facadeList, streamIncrGenerateStrategy);
EasyMock.replay(streamIncrGenerateStrategy);
streamCodeGenerator.build();
assertGenerateContentEqual(timestamp, collectionName, "S4totalpayListener.scala");
EasyMock.verify(streamIncrGenerateStrategy);
}
Aggregations