net.ibizsys.dataflow.spark.SparkPSDataFlowSystemEngine Maven / Gradle / Ivy
The newest version!
package net.ibizsys.dataflow.spark;
import org.springframework.util.ObjectUtils;
import net.ibizsys.dataflow.core.PSDataFlowSystemEngineBase;
import net.ibizsys.dataflow.spark.dataentity.dataflow.ISparkPSDEDataFlowEngine;
import net.ibizsys.model.PSModelUtils;
import net.ibizsys.model.dataentity.IPSDataEntity;
import net.ibizsys.model.dataentity.dataflow.IPSDEDataFlow;
public class SparkPSDataFlowSystemEngine extends PSDataFlowSystemEngineBase implements ISparkPSDataFlowSystemEngine {
@Override
protected Object onExecutePSDEDataFlow(String id, Object[] args) throws Throwable {
java.util.List psDataEntityList = this.getPSSystem().getAllPSDataEntities();
if (!ObjectUtils.isEmpty(psDataEntityList)) {
for (IPSDataEntity iPSDataEntity : psDataEntityList) {
java.util.List psDEDataFlowList = iPSDataEntity.getAllPSDEDataFlows();
if (!ObjectUtils.isEmpty(psDEDataFlowList)) {
for (IPSDEDataFlow iPSDEDataFlow : psDEDataFlowList) {
String tag = PSModelUtils.calcFullUniqueTag(iPSDEDataFlow, true);
if (!tag.equalsIgnoreCase(id)) {
continue;
}
ISparkPSDEDataFlowEngine iSparkPSDEDataFlowEngine = this.getPSModelEngineHolder().getPSModelEngine(iPSDEDataFlow, ISparkPSDEDataFlowEngine.class);
iSparkPSDEDataFlowEngine.execute(args);
break;
}
}
}
}
return null;
}
//
// @Override
// protected Object onExecute(Object[] args) throws Throwable {
//
// //获取传入的流标识
// String psDEDataFlowTag = "zcyw.fxtxd.hmcx";
//
// Map params = new HashMap<>();
//
// Map dataContextMap = new HashMap();
//
// Map sessionContextMap = new HashMap();
//
//
// params.put(DEDataFlowParamValueType.DATACONTEXT.value, dataContextMap);
// params.put(DEDataFlowParamValueType.SESSION.value, sessionContextMap);
//
// dataContextMap.put("DFHM", "1dsd''34");
//
// sessionContextMap.put("ztlx", "ztlx2222'");
//
// //枚举全部实体数据流
// //枚举所有的实体数据同步
// java.util.List psDataEntityList =
// this.getPSSystem().getAllPSDataEntities();
// if(!ObjectUtils.isEmpty(psDataEntityList)) {
// for(IPSDataEntity iPSDataEntity : psDataEntityList) {
// java.util.List psDEDataFlowList =
// iPSDataEntity.getAllPSDEDataFlows();
// if(!ObjectUtils.isEmpty(psDEDataFlowList)) {
// for(IPSDEDataFlow iPSDEDataFlow : psDEDataFlowList) {
//
// String tag = PSModelUtils.calcFullUniqueTag(iPSDEDataFlow, true);
// if(!psDEDataFlowTag.equalsIgnoreCase(tag)) {
// continue;
// }
//
// ISparkPSDEDataFlowEngine iSparkPSDEDataFlowEngine =
// this.getPSModelEngineHolder().getPSModelEngine(iPSDEDataFlow,
// ISparkPSDEDataFlowEngine.class);
//
//
// iSparkPSDEDataFlowEngine.start(new Object[] {params});
//
// }
// }
// }
// }
//
//
// return null;
// }
}