no message

parent e36dc75c
package com.jz.dmp.cmdexectool.common.constant;
/**
* @ClassName: DatasouceTypeConstant
* @Description: TODO(通用常亮)
* @author Bellamy
* @date 2021年2月26日
*
*/
public class DatasouceTypeConstant {
public static final int MySQL = 1;
public static final int SQLServer = 2;
public static final int PostgreSQL = 3;
public static final int Oracle = 4;
public static final int DM = 5;
public static final int DB2 = 6;
public static final int Hive = 7;
public static final int Impala = 8;
public static final int Kudu = 9;
public static final int HDFS = 10;
public static final int FTP = 11;
public static final int Elasticsearch = 12;
}
package com.jz.dmp.cmdexectool.scheduler.common.task.sync;
import com.alibaba.fastjson.JSONObject;
import com.jz.dmp.cmdexectool.common.constant.CommConstant;
import com.jz.dmp.cmdexectool.common.constant.DatasouceTypeConstant;
import com.jz.dmp.cmdexectool.common.utils.FreeMarkerUtils;
import com.jz.dmp.cmdexectool.controller.bean.DmpProjectConfigInfoDto;
import com.jz.dmp.cmdexectool.entity.DmpSyncingDatasource;
import com.jz.dmp.cmdexectool.mapper.DmpSyncingDatasourceDao;
import com.jz.dmp.cmdexectool.scheduler.common.process.ResourceInfo;
import com.jz.dmp.cmdexectool.scheduler.common.task.AbstractParameters;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ClassName: SyncParameters
......@@ -55,7 +62,36 @@ public class SyncParameters extends AbstractParameters {
private List<ResourceInfo> resourceList;
public SyncParameters(String script, DmpProjectConfigInfoDto projectConfigInfoDto, DmpSyncingDatasourceDao dmpSyncingDatasourceDao, FreeMarkerConfigurer freeMarkerConfig) {
source = "";
env = "";
sink = "";
transform = "";
this.script = script;
JSONObject scriptObj = JSONObject.parseObject(script);
Map<String, Object> scriptJson = (Map<String, Object>) scriptObj.get("params");
Map<String, Object> scripts = (Map<String, Object>) scriptJson.get("scripts");
Map<String, Object> source = (Map<String, Object>) scripts.get("reader");
//evn
Map<String, String> envModel = new HashMap<String, String>();
envModel.put("sparkappname", "Waterdrop");
env = FreeMarkerUtils.freemakerJson(CommConstant.WATERDROP_FTL_ENV, envModel, freeMarkerConfig);
//Jdbc(MySQL、Oracle、SqlServer、PostgreSQL、Informix、DB2)
//source
Integer sourceId = Integer.valueOf((String) source.get("sourceDbId"));
DmpSyncingDatasource dmpSyncingDatasource = dmpSyncingDatasourceDao.queryById(sourceId);
Integer datasouceType = dmpSyncingDatasource.getDatasourceType();
switch (datasouceType) {
case DatasouceTypeConstant.MySQL:
break;
case DatasouceTypeConstant.SQLServer:
default:
break;
}
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment