forked from github/dataease
feat: 优化查询任务日志
This commit is contained in:
parent
cd03c571e2
commit
4352479850
@ -13,7 +13,9 @@ import java.util.List;
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExtDataSetTaskMapper {
|
||||
List<DataSetTaskLogDTO> list(GridExample example);
|
||||
List<DataSetTaskLogDTO> listTaskLog(GridExample example);
|
||||
|
||||
List<DataSetTaskDTO> taskList(GridExample example);
|
||||
|
||||
List<DataSetTaskDTO> taskWithTriggers(GridExample example);
|
||||
}
|
||||
|
@ -14,9 +14,9 @@
|
||||
<result column="NEXT_FIRE_TIME" jdbcType="BIGINT" property="nextExecTime"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="list" resultMap="BaseResult" parameterType="io.dataease.base.domain.DatasetTableTaskLog">
|
||||
<select id="listTaskLog" resultMap="BaseResult" parameterType="io.dataease.base.domain.DatasetTableTaskLog">
|
||||
SELECT dataset_table_task_log.*, dataset_table_task.name, dataset_table.name as dataset_name
|
||||
FROM (select GET_V_AUTH_MODEL_WITH_PRIVILEGE (#{extendCondition}, 'dataset',1) cids) t, dataset_table_task_log
|
||||
FROM dataset_table_task_log
|
||||
LEFT JOIN dataset_table_task ON dataset_table_task_log.task_id = dataset_table_task.id
|
||||
LEFT JOIN dataset_table ON dataset_table_task_log.table_id = dataset_table.id
|
||||
<if test="_parameter != null">
|
||||
@ -32,7 +32,23 @@
|
||||
|
||||
<select id="taskList" resultMap="TaskResult" parameterType="io.dataease.base.mapper.ext.query.GridExample">
|
||||
SELECT dataset_table.name as table_name, get_auths(dataset_table_task.table_id,'dataset', #{extendCondition}) as `privileges`,dataset_table_task.* , qrtz_triggers.NEXT_FIRE_TIME
|
||||
FROM (select GET_V_AUTH_MODEL_WITH_PRIVILEGE (#{extendCondition}, 'dataset', 1) cids) t, dataset_table_task
|
||||
FROM dataset_table_task
|
||||
left join dataset_table on dataset_table.id=dataset_table_task.table_id
|
||||
left join qrtz_triggers on dataset_table_task.id=qrtz_triggers.TRIGGER_NAME
|
||||
<if test="_parameter != null">
|
||||
<include refid="io.dataease.base.mapper.ext.query.GridSql.gridCondition" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="orderByClause == null">
|
||||
order by dataset_table_task.create_time desc
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="taskWithTriggers" resultMap="TaskResult" parameterType="io.dataease.base.mapper.ext.query.GridExample">
|
||||
SELECT dataset_table.name as table_name, get_auths(dataset_table_task.table_id,'dataset', #{extendCondition}) as `privileges`,dataset_table_task.* , qrtz_triggers.NEXT_FIRE_TIME
|
||||
FROM dataset_table_task
|
||||
left join dataset_table on dataset_table.id=dataset_table_task.table_id
|
||||
left join qrtz_triggers on dataset_table_task.id=qrtz_triggers.TRIGGER_NAME
|
||||
<if test="_parameter != null">
|
||||
|
@ -174,6 +174,9 @@ public class GridExample {
|
||||
case "extra":
|
||||
addCriterion(field);
|
||||
break;
|
||||
case "sql in":
|
||||
addCriterion(field);
|
||||
break;
|
||||
}
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
@ -68,6 +68,6 @@ public class ExcelReaderUtil {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ExcelReaderUtil.readExcel("跑步数据汇总——万马奔腾版0729.xlsx", new FileInputStream("/Users/taojinlong/Desktop/跑步数据汇总——万马奔腾版0729.xlsx"));
|
||||
ExcelReaderUtil.readExcel("根据前100行判断数据类型.xls", new FileInputStream("/Users/taojinlong/Desktop/根据前100行判断数据类型.xls"));
|
||||
}
|
||||
}
|
||||
|
@ -238,6 +238,7 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
value = sstRecord.getString(lsrec.getSSTIndex()).toString().trim();
|
||||
value = value.equals("") ? "" : value;
|
||||
cellList.add(thisColumn, value);
|
||||
checkType(value, thisColumn);
|
||||
checkRowIsNull(value); //如果里面某个单元格含有值,则标识该行不为空行
|
||||
}
|
||||
break;
|
||||
@ -259,7 +260,7 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
value = value.equals("") ? "" : value;
|
||||
//向容器加入列值
|
||||
cellList.add(thisColumn, value);
|
||||
if(formatIndex == 59){
|
||||
if(formatIndex == 59 || formatIndex== 14){
|
||||
totalSheets.get(totalSheets.size() -1).getFields().get(thisColumn).setFieldType("DATETIME");
|
||||
}else {
|
||||
checkType(value, thisColumn);
|
||||
@ -374,12 +375,17 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
type = "TEXT";
|
||||
}
|
||||
|
||||
String oldType = totalSheets.get(totalSheets.size() -1).getFields().get(thisColumn).getFieldType();
|
||||
if(type.equalsIgnoreCase("LONG") && oldType.equalsIgnoreCase("TEXT")){
|
||||
if(curRow==1){
|
||||
totalSheets.get(totalSheets.size() -1).getFields().get(thisColumn).setFieldType(type);
|
||||
}
|
||||
if(type.equalsIgnoreCase("DOUBLE")){
|
||||
totalSheets.get(totalSheets.size() -1).getFields().get(thisColumn).setFieldType(type);
|
||||
if(curRow > 1) {
|
||||
String oldType = totalSheets.get(totalSheets.size() -1).getFields().get(thisColumn).getFieldType();
|
||||
if(type.equalsIgnoreCase("TEXT")){
|
||||
totalSheets.get(totalSheets.size() -1).getFields().get(thisColumn).setFieldType(type);
|
||||
}
|
||||
if(type.equalsIgnoreCase("DOUBLE") && oldType.equalsIgnoreCase("LONG")){
|
||||
totalSheets.get(totalSheets.size() -1).getFields().get(thisColumn).setFieldType(type);
|
||||
}
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
@ -217,6 +217,15 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
return;
|
||||
}
|
||||
lastIndex += new String(ch, start, length);
|
||||
if(curRow==5){
|
||||
System.out.println("---------");
|
||||
System.out.println(ch);
|
||||
System.out.println("start: " + start);
|
||||
System.out.println("length: " + length);
|
||||
System.out.println(lastIndex);
|
||||
System.out.println("---------");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -246,6 +255,7 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
} else if ("v".equals(name)) {
|
||||
//v => 单元格的值,如果单元格是字符串,则v标签的值为该字符串在SST中的索引
|
||||
String value = this.getDataValue(lastIndex.trim(), "");//根据索引值获取对应的单元格值
|
||||
|
||||
if (preRef == null) {
|
||||
preRef = ref;
|
||||
}
|
||||
@ -413,14 +423,18 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
if(CollectionUtils.isEmpty(this.getFields())){
|
||||
throw new RuntimeException(Translator.get("i18n_excel_header_empty"));
|
||||
}
|
||||
if(type.equalsIgnoreCase("LONG") && this.getFields().get(curCol).getFieldType().equalsIgnoreCase("TEXT")){
|
||||
this.getFields().get(curCol).setFieldType(type);
|
||||
}
|
||||
if(type.equalsIgnoreCase("DOUBLE") && !this.getFields().get(curCol).getFieldType().equalsIgnoreCase("DATETIME")){
|
||||
this.getFields().get(curCol).setFieldType(type);
|
||||
}
|
||||
if(type.equalsIgnoreCase("DATETIME")){
|
||||
if(curRow==2){
|
||||
this.getFields().get(curCol).setFieldType(type);
|
||||
}else {
|
||||
if(type.equalsIgnoreCase("TEXT")){
|
||||
this.getFields().get(curCol).setFieldType(type);
|
||||
}
|
||||
if(type.equalsIgnoreCase("DOUBLE") && this.getFields().get(curCol).getFieldType().equalsIgnoreCase("LONG")){
|
||||
this.getFields().get(curCol).setFieldType(type);
|
||||
}
|
||||
if(type.equalsIgnoreCase("DATETIME")){
|
||||
this.getFields().get(curCol).setFieldType(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
return thisStr;
|
||||
|
@ -48,7 +48,7 @@ public class DataSetTableTaskController {
|
||||
public Pager<List<DataSetTaskDTO>> taskList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody BaseGridRequest request) {
|
||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||
|
||||
return PageUtils.setPageInfo(page, dataSetTableTaskService.taskList(request));
|
||||
return PageUtils.setPageInfo(page, dataSetTableTaskService.taskList4User(request));
|
||||
}
|
||||
|
||||
@PostMapping("/lastExecStatus")
|
||||
|
@ -8,11 +8,26 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class BaseGridRequest implements Serializable {
|
||||
|
||||
private List<ConditionEntity> conditions;
|
||||
|
||||
public List<ConditionEntity> getConditions() {
|
||||
return conditions;
|
||||
}
|
||||
|
||||
public void setConditions(List<ConditionEntity> conditions) {
|
||||
this.conditions = conditions;
|
||||
}
|
||||
|
||||
public List<String> getOrders() {
|
||||
return orders;
|
||||
}
|
||||
|
||||
public void setOrders(List<String> orders) {
|
||||
this.orders = orders;
|
||||
}
|
||||
|
||||
private List<String> orders;
|
||||
|
||||
public GridExample convertExample(){
|
||||
|
@ -11,7 +11,7 @@ public class MysqlConfigration extends JdbcDTO {
|
||||
|
||||
public String getJdbc() {
|
||||
// 连接参数先写死,后边要把编码、时区等参数放到数据源的设置中
|
||||
return "jdbc:mysql://HOSTNAME:PORT/DATABASE?characterEncoding=UTF-8&connectTimeout=5000&socketTimeout=5000"
|
||||
return "jdbc:mysql://HOSTNAME:PORT/DATABASE?characterEncoding=UTF-8&connectTimeout=5000"
|
||||
.replace("HOSTNAME", getHost())
|
||||
.replace("PORT", getPort().toString())
|
||||
.replace("DATABASE", getDataBase());
|
||||
|
@ -132,7 +132,7 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
} catch (SQLException e) {
|
||||
DataEaseException.throwException(e);
|
||||
} catch (Exception e) {
|
||||
DataEaseException.throwException(e);
|
||||
DataEaseException.throwException(Translator.get("i18n_datasource_connect_error") + e.getMessage());
|
||||
} finally {
|
||||
if(connection != null){
|
||||
connection.close();
|
||||
@ -307,7 +307,7 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
resultSet.close();
|
||||
ps.close();
|
||||
} catch (Exception e) {
|
||||
DataEaseException.throwException(e);
|
||||
DataEaseException.throwException(Translator.get("i18n_datasource_connect_error") + e.getMessage());
|
||||
} finally {
|
||||
if(con != null){con.close();}
|
||||
}
|
||||
@ -429,7 +429,7 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
driver = oracleConfigration.getDriver();
|
||||
jdbcurl = oracleConfigration.getJdbc();
|
||||
props.put( "oracle.net.CONNECT_TIMEOUT" , "5000") ;
|
||||
props.put( "oracle.jdbc.ReadTimeout" , "5000" ) ;
|
||||
// props.put( "oracle.jdbc.ReadTimeout" , "5000" ) ;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -991,6 +991,13 @@ public class DataSetTableService {
|
||||
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
|
||||
datasourceRequest.setQuery(qp.wrapSql(sql));
|
||||
List<String> sqlFileds = new ArrayList<>();
|
||||
try{
|
||||
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed -> {
|
||||
sqlFileds.add(filed);
|
||||
});
|
||||
}catch (Exception e){
|
||||
DataEaseException.throwException(Translator.get("i18n_check_sql_error") + e.getMessage());
|
||||
}
|
||||
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed -> {
|
||||
sqlFileds.add(filed);
|
||||
});
|
||||
|
@ -59,16 +59,21 @@ public class DataSetTableTaskLogService {
|
||||
conditionEntities.add(entity);
|
||||
|
||||
ConditionEntity entity2 = new ConditionEntity();
|
||||
entity2.setOperator("extra");
|
||||
entity2.setField(" FIND_IN_SET(dataset_table_task_log.table_id,cids) ");
|
||||
entity2.setField("dataset_table.id");
|
||||
entity2.setOperator("sql in");
|
||||
entity2.setValue(" SELECT\tsys_auth.auth_source FROM sys_auth\n" +
|
||||
"LEFT JOIN sys_auth_detail ON sys_auth.id = sys_auth_detail.auth_id\n" +
|
||||
"LEFT JOIN dataset_table ON dataset_table.id = sys_auth.auth_source\n" +
|
||||
"WHERE\tsys_auth_detail.privilege_type = '1'and sys_auth.auth_source_type = 'dataset'\n" +
|
||||
"AND ((sys_auth.auth_target_type = 'dept'AND sys_auth.auth_target in ( SELECT dept_id FROM sys_user WHERE user_id = userId ))\n" +
|
||||
"\tOR (sys_auth.auth_target_type = 'user'AND sys_auth.auth_target = '1')OR (sys_auth.auth_target_type = 'role'AND sys_auth.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = userId ))\n" +
|
||||
"\tOR (1 = ( SELECT is_admin FROM sys_user WHERE user_id = userId ))\n" +
|
||||
"\t) ".replace("userId", AuthUtils.getUser().getUserId().toString()));
|
||||
conditionEntities.add(entity2);
|
||||
|
||||
request.setConditions(conditionEntities);
|
||||
}
|
||||
|
||||
GridExample gridExample = request.convertExample();
|
||||
gridExample.setExtendCondition(AuthUtils.getUser().getUserId().toString());
|
||||
List<DataSetTaskLogDTO> dataSetTaskLogDTOS = extDataSetTaskMapper.list(gridExample);
|
||||
List<DataSetTaskLogDTO> dataSetTaskLogDTOS = extDataSetTaskMapper.listTaskLog(gridExample);
|
||||
dataSetTaskLogDTOS.forEach(dataSetTaskLogDTO -> {
|
||||
if(StringUtils.isEmpty(dataSetTaskLogDTO.getName())){
|
||||
dataSetTaskLogDTO.setName(dataSetTaskLogDTO.getTaskId());
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.dataease.service.dataset;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import io.dataease.base.domain.*;
|
||||
import io.dataease.base.mapper.DatasetTableMapper;
|
||||
import io.dataease.base.mapper.DatasetTableTaskMapper;
|
||||
@ -97,6 +98,7 @@ public class DataSetTableTaskService {
|
||||
execNow(datasetTableTask);
|
||||
}
|
||||
scheduleService.addSchedule(datasetTableTask);
|
||||
checkTaskIsStopped(datasetTableTask);
|
||||
return datasetTableTask;
|
||||
}
|
||||
|
||||
@ -172,6 +174,24 @@ public class DataSetTableTaskService {
|
||||
}
|
||||
}
|
||||
|
||||
public void checkTaskIsStopped(DatasetTableTask datasetTableTask){
|
||||
if(StringUtils.isNotEmpty(datasetTableTask.getEnd()) && datasetTableTask.getEnd().equalsIgnoreCase("1")){
|
||||
BaseGridRequest request = new BaseGridRequest();
|
||||
ConditionEntity conditionEntity = new ConditionEntity();
|
||||
conditionEntity.setField("dataset_table_task.id");
|
||||
conditionEntity.setOperator("eq");
|
||||
conditionEntity.setValue(datasetTableTask.getId());
|
||||
request.setConditions(Arrays.asList(conditionEntity));
|
||||
List<DataSetTaskDTO> dataSetTaskDTOS = taskWithTriggers(request);
|
||||
if(CollectionUtils.isEmpty(dataSetTaskDTOS)){
|
||||
return;
|
||||
}
|
||||
if(dataSetTaskDTOS.get(0).getNextExecTime() == null || dataSetTaskDTOS.get(0).getNextExecTime() <= 0){
|
||||
datasetTableTask.setStatus(TaskStatus.Stopped.name());
|
||||
update(datasetTableTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updateTaskStatus(DatasetTableTask datasetTableTask, JobStatus lastExecStatus){
|
||||
datasetTableTask.setLastExecStatus(lastExecStatus.name());
|
||||
if(datasetTableTask.getRate().equalsIgnoreCase(ScheduleType.SIMPLE.name())){
|
||||
@ -184,7 +204,7 @@ public class DataSetTableTaskService {
|
||||
conditionEntity.setOperator("eq");
|
||||
conditionEntity.setValue(datasetTableTask.getId());
|
||||
request.setConditions(Arrays.asList(conditionEntity));
|
||||
List<DataSetTaskDTO> dataSetTaskDTOS = taskList(request);
|
||||
List<DataSetTaskDTO> dataSetTaskDTOS = taskWithTriggers(request);
|
||||
if(CollectionUtils.isEmpty(dataSetTaskDTOS)){
|
||||
return;
|
||||
}
|
||||
@ -214,11 +234,19 @@ public class DataSetTableTaskService {
|
||||
return datasetTableTaskMapper.selectByExample(datasetTableTaskExample);
|
||||
}
|
||||
|
||||
public List<DataSetTaskDTO> taskList(BaseGridRequest request) {
|
||||
List<ConditionEntity> conditionEntities = request.getConditions() == null ? new ArrayList<>() : request.getConditions();
|
||||
public List<DataSetTaskDTO> taskList4User(BaseGridRequest request) {
|
||||
List<ConditionEntity> conditionEntities = request.getConditions() == null ? new ArrayList<>() : new ArrayList(request.getConditions());;
|
||||
ConditionEntity entity = new ConditionEntity();
|
||||
entity.setOperator("extra");
|
||||
entity.setField(" FIND_IN_SET(dataset_table_task.table_id,cids) ");
|
||||
entity.setField("dataset_table.id");
|
||||
entity.setOperator("sql in");
|
||||
entity.setValue(" SELECT\tsys_auth.auth_source FROM sys_auth\n" +
|
||||
"LEFT JOIN sys_auth_detail ON sys_auth.id = sys_auth_detail.auth_id\n" +
|
||||
"LEFT JOIN dataset_table ON dataset_table.id = sys_auth.auth_source\n" +
|
||||
"WHERE\tsys_auth_detail.privilege_type = '1'and sys_auth.auth_source_type = 'dataset'\n" +
|
||||
"AND ((sys_auth.auth_target_type = 'dept'AND sys_auth.auth_target in ( SELECT dept_id FROM sys_user WHERE user_id = userId ))\n" +
|
||||
"\tOR (sys_auth.auth_target_type = 'user'AND sys_auth.auth_target = '1')OR (sys_auth.auth_target_type = 'role'AND sys_auth.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = userId ))\n" +
|
||||
"\tOR (1 = ( SELECT is_admin FROM sys_user WHERE user_id = userId ))\n" +
|
||||
"\t) ".replace("userId", AuthUtils.getUser().getUserId().toString()));
|
||||
conditionEntities.add(entity);
|
||||
request.setConditions(conditionEntities);
|
||||
GridExample gridExample = request.convertExample();
|
||||
@ -227,6 +255,12 @@ public class DataSetTableTaskService {
|
||||
return dataSetTaskDTOS;
|
||||
}
|
||||
|
||||
public List<DataSetTaskDTO> taskWithTriggers(BaseGridRequest request) {
|
||||
GridExample gridExample = request.convertExample();
|
||||
List<DataSetTaskDTO> dataSetTaskDTOS = extDataSetTaskMapper.taskWithTriggers(gridExample);
|
||||
return dataSetTaskDTOS;
|
||||
}
|
||||
|
||||
private void checkName(DataSetTaskRequest dataSetTaskRequest) {
|
||||
DatasetTableTaskExample datasetTableTaskExample = new DatasetTableTaskExample();
|
||||
DatasetTableTaskExample.Criteria criteria = datasetTableTaskExample.createCriteria();
|
||||
|
@ -96,6 +96,8 @@ public class ExtractDataService {
|
||||
private static String extention = "txt";
|
||||
private static String root_path = "/opt/dataease/data/kettle/";
|
||||
|
||||
@Value("${kettle.files.keep:false}")
|
||||
private boolean kettleFilesKeep;
|
||||
@Value("${carte.host:127.0.0.1}")
|
||||
private String carte;
|
||||
@Value("${carte.port:8080}")
|
||||
@ -235,13 +237,14 @@ public class ExtractDataService {
|
||||
return;
|
||||
}
|
||||
if (datasetTableTask.getStatus().equalsIgnoreCase(TaskStatus.Stopped.name()) || datasetTableTask.getStatus().equalsIgnoreCase(TaskStatus.Pending.name())) {
|
||||
LogUtil.info("Skip synchronization task, task ID : " + datasetTableTask.getId());
|
||||
LogUtil.info("Skip synchronization task: {} ,due to task status is {}", datasetTableTask.getId(), datasetTableTask.getStatus());
|
||||
dataSetTableTaskService.checkTaskIsStopped(datasetTableTask);
|
||||
return;
|
||||
}
|
||||
|
||||
Long startTime = System.currentTimeMillis();
|
||||
if (existSyncTask(datasetTable, datasetTableTask, startTime)) {
|
||||
LogUtil.info("Skip synchronization task for dataset, dataset ID : " + datasetTableId);
|
||||
LogUtil.info("Skip synchronization task for dataset due to exist other synctask, dataset ID : " + datasetTableId);
|
||||
return;
|
||||
}
|
||||
DatasetTableTaskLog datasetTableTaskLog = getDatasetTableTaskLog(datasetTableId, taskId, startTime);
|
||||
@ -269,7 +272,7 @@ public class ExtractDataService {
|
||||
String dorisTablColumnSql = createDorisTablColumnSql(datasetTableFields);
|
||||
|
||||
boolean msg = false;
|
||||
JobStatus jobStatus = JobStatus.Completed;
|
||||
JobStatus lastExecStatus = JobStatus.Completed;
|
||||
Long execTime = null;
|
||||
switch (updateType) {
|
||||
case all_scope: // 全量更新
|
||||
@ -290,17 +293,19 @@ public class ExtractDataService {
|
||||
replaceTable(DorisTableUtils.dorisName(datasetTableId));
|
||||
saveSucessLog(datasetTableTaskLog);
|
||||
msg = true;
|
||||
jobStatus = JobStatus.Completed;
|
||||
lastExecStatus = JobStatus.Completed;
|
||||
} catch (Exception e) {
|
||||
saveErrorLog(datasetTableId, taskId, e);
|
||||
msg = false;
|
||||
jobStatus = JobStatus.Error;
|
||||
lastExecStatus = JobStatus.Error;
|
||||
} finally {
|
||||
try { deleteFile("all_scope", datasetTableId); }catch (Exception ignore){}
|
||||
try { sendWebMsg(datasetTable, datasetTableTask, datasetTableTaskLog, msg); }catch (Exception ignore){}
|
||||
try { dataSetTableTaskService.updateTaskStatus(datasetTableTask, jobStatus); }catch (Exception ignore){}
|
||||
try { updateTableStatus(datasetTableId, datasetTable, jobStatus, execTime); }catch (Exception ignore){}
|
||||
try { dropDorisTable(DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTableId))); }catch (Exception ignore){}
|
||||
try { deleteFile("all_scope", datasetTableId); }catch (Exception ignore){ System.out.println(ignore.getMessage());}
|
||||
try { sendWebMsg(datasetTable, datasetTableTask, datasetTableTaskLog, msg); }catch (Exception ignore){ System.out.println(ignore.getMessage());}
|
||||
try { dataSetTableTaskService.updateTaskStatus(datasetTableTask, lastExecStatus); }catch (Exception ignore){
|
||||
System.out.println(ignore.getMessage());
|
||||
}
|
||||
try { updateTableStatus(datasetTableId, datasetTable, lastExecStatus, execTime); }catch (Exception ignore){ System.out.println(ignore.getMessage());}
|
||||
try { dropDorisTable(DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTableId))); }catch (Exception ignore){ System.out.println(ignore.getMessage());}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -339,16 +344,16 @@ public class ExtractDataService {
|
||||
saveSucessLog(datasetTableTaskLog);
|
||||
|
||||
msg = true;
|
||||
jobStatus = JobStatus.Completed;
|
||||
lastExecStatus = JobStatus.Completed;
|
||||
} catch (Exception e) {
|
||||
saveErrorLog(datasetTableId, taskId, e);
|
||||
msg = false;
|
||||
jobStatus = JobStatus.Error;
|
||||
lastExecStatus = JobStatus.Error;
|
||||
} finally {
|
||||
try { deleteFile("incremental_add", datasetTableId); deleteFile("incremental_delete", datasetTableId); }catch (Exception ignore){}
|
||||
try { sendWebMsg(datasetTable, datasetTableTask, datasetTableTaskLog, msg); }catch (Exception ignore){}
|
||||
try { dataSetTableTaskService.updateTaskStatus(datasetTableTask, jobStatus); }catch (Exception ignore){}
|
||||
try { updateTableStatus(datasetTableId, datasetTable, jobStatus, execTime); }catch (Exception ignore){}
|
||||
try { dataSetTableTaskService.updateTaskStatus(datasetTableTask, lastExecStatus); }catch (Exception ignore){}
|
||||
try { updateTableStatus(datasetTableId, datasetTable, lastExecStatus, execTime); }catch (Exception ignore){}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -424,7 +429,7 @@ public class ExtractDataService {
|
||||
|
||||
}
|
||||
|
||||
private String createDorisTablColumnSql(List<DatasetTableField> datasetTableFields) {
|
||||
private String createDorisTablColumnSql(final List<DatasetTableField> datasetTableFields) {
|
||||
String Column_Fields = "dataease_uuid varchar(50), `";
|
||||
for (DatasetTableField datasetTableField : datasetTableFields) {
|
||||
Column_Fields = Column_Fields + datasetTableField.getDataeaseName() + "` ";
|
||||
@ -915,6 +920,9 @@ public class ExtractDataService {
|
||||
}
|
||||
|
||||
public void deleteFile(String type, String dataSetTableId) {
|
||||
if(kettleFilesKeep){
|
||||
return;
|
||||
}
|
||||
String transName = null;
|
||||
String jobName = null;
|
||||
String fileName = null;
|
||||
|
@ -276,3 +276,5 @@ i18n_msg_type_dataset_sync_faild=Dataset synchronization failed
|
||||
i18n_data_not_sync=Please sync data first
|
||||
i18n_excel_colume_change=The column name of Excel is inconsistent with the original data set
|
||||
i18n_timed_task=Timed Task
|
||||
i18n_datasource_connect_error=Data source connection exception:
|
||||
i18n_check_sql_error=Check incremental SQL exception,
|
@ -256,8 +256,8 @@ i18n_not_exec_add_sync=没有已完成的同步任务,无法进行增量同步
|
||||
i18n_excel_header_empty=Excel第一行为空
|
||||
i18n_excel_empty_column=第一行存在空单元格
|
||||
i18n_custom_ds_delete=自定义数据集所关联数据被删除,无法正常显示
|
||||
i18n_sql_add_not_matching=增量添加 sql 的数据列与数据集不匹配,
|
||||
i18n_sql_delete_not_matching=增量删除 sql 的数据列与数据集不匹配,
|
||||
i18n_sql_add_not_matching=增量添加 SQL 的数据列与数据集不匹配,
|
||||
i18n_sql_delete_not_matching=增量删除 SQL 的数据列与数据集不匹配,
|
||||
i18n_cst_ds_tb_or_field_deleted=自定义数据集所关联数据被删除或字段发生变化,无法正常显示
|
||||
i18n_no_all_delete_privilege_folder=该目录下存在没有管理权限或查看权限的资源,无法删除
|
||||
i18n_excel_field_repeat=Excel存在重复字段,请修改后重新上传
|
||||
@ -275,3 +275,5 @@ i18n_msg_type_dataset_sync_faild=数据集同步失败
|
||||
i18n_data_not_sync=请先完成数据同步
|
||||
i18n_excel_colume_change=Excel的列名与原数据集不一致
|
||||
i18n_timed_task=定时任务
|
||||
i18n_datasource_connect_error=数据源连接异常:
|
||||
i18n_check_sql_error=校验增量 SQL 异常,
|
||||
|
@ -278,3 +278,5 @@ i18n_msg_type_dataset_sync_faild=數據集同步失敗
|
||||
i18n_data_not_sync=請先完成數據同步
|
||||
i18n_excel_colume_change=Excel的列名與原數據集不一致
|
||||
i18n_timed_task=定時任務
|
||||
i18n_datasource_connect_error=數據源連接異常:
|
||||
i18n_check_sql_error=校驗增量SQL異常,
|
@ -351,7 +351,7 @@ export default {
|
||||
created() {
|
||||
this.timer = setInterval(() => {
|
||||
this.search(this.last_condition, false)
|
||||
}, 5000)
|
||||
}, 10000)
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer)
|
||||
|
@ -139,7 +139,7 @@ export default {
|
||||
if (!this.timer) {
|
||||
this.timer = setInterval(() => {
|
||||
this.search(this.last_condition, false)
|
||||
}, 5000)
|
||||
}, 10000)
|
||||
}
|
||||
},
|
||||
destroyTimer() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<layout-content>
|
||||
|
||||
<el-row style="height: 100%;width: 100%;">
|
||||
<el-row>
|
||||
<el-tabs v-model="tabActive" @tab-click="changeTab">
|
||||
<el-tab-pane :label="$t('dataset.task.list')" name="DatasetTaskList">
|
||||
<dataset-task-list v-if="tabActive=='DatasetTaskList'" :param="task" :transCondition="transCondition" @jumpTaskRecord="jumpTaskRecord" />
|
||||
|
Loading…
Reference in New Issue
Block a user