feat: 限制数据集只有一个同步任务;数据源支持修改密码和端口号

This commit is contained in:
taojinlong 2021-05-31 12:49:55 +08:00
parent b8a64a3fc5
commit 99bae93fb5
2 changed files with 21 additions and 7 deletions

View File

@ -240,8 +240,7 @@ public class ExtractDataService {
switch (updateType) {
// 全量更新
case all_scope:
datasetTableTaskLog = writeDatasetTableTaskLog(datasetTableTaskLog, datasetTableId, taskId);
// TODO before: check doris table column type
datasetTableTaskLog = getDatasetTableTaskLog(datasetTableTaskLog, datasetTableId, taskId);
createDorisTable(DorisTableUtils.dorisName(datasetTableId), dorisTablColumnSql);
createDorisTable(DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTableId)), dorisTablColumnSql);
generateTransFile("all_scope", datasetTable, datasource, datasetTableFields, null);
@ -346,6 +345,21 @@ public class ExtractDataService {
}
}
private DatasetTableTaskLog getDatasetTableTaskLog(DatasetTableTaskLog datasetTableTaskLog, String datasetTableId, String taskId) {
datasetTableTaskLog.setTableId(datasetTableId);
datasetTableTaskLog.setTaskId(taskId);
datasetTableTaskLog.setStatus(JobStatus.Underway.name());
for (int i=0;i<5;i++){
List<DatasetTableTaskLog> datasetTableTaskLogs = dataSetTableTaskLogService.select(datasetTableTaskLog);
if(CollectionUtils.isNotEmpty(datasetTableTaskLogs)){
return datasetTableTaskLogs.get(0);
}
}
datasetTableTaskLog.setStartTime(System.currentTimeMillis());
dataSetTableTaskLogService.save(datasetTableTaskLog);
return datasetTableTaskLog;
}
private void extractData(DatasetTable datasetTable, String extractType) throws Exception {

View File

@ -19,6 +19,9 @@
</el-select>
</el-form-item>
<el-form-item v-if="form.configuration.dataSourceType=='jdbc'" :label="$t('datasource.host')" prop="configuration.host">
<el-input v-model="form.configuration.host" autocomplete="off" :disabled="formType=='modify'" />
</el-form-item>
<el-form-item v-if="form.configuration.dataSourceType=='jdbc'" :label="$t('datasource.data_base')" prop="configuration.dataBase">
<el-input v-model="form.configuration.dataBase" autocomplete="off" :disabled="formType=='modify'" />
</el-form-item>
@ -26,13 +29,10 @@
<el-input v-model="form.configuration.username" autocomplete="off" :disabled="formType=='modify'" />
</el-form-item>
<el-form-item v-if="form.configuration.dataSourceType=='jdbc'" :label="$t('datasource.password')" prop="configuration.password">
<el-input v-model="form.configuration.password" autocomplete="off" show-password :disabled="formType=='modify'" />
</el-form-item>
<el-form-item v-if="form.configuration.dataSourceType=='jdbc'" :label="$t('datasource.host')" prop="configuration.host">
<el-input v-model="form.configuration.host" autocomplete="off" :disabled="formType=='modify'" />
<el-input v-model="form.configuration.password" autocomplete="off" show-password />
</el-form-item>
<el-form-item v-if="form.configuration.dataSourceType=='jdbc'" :label="$t('datasource.port')" prop="configuration.port">
<el-input v-model="form.configuration.port" autocomplete="off" :disabled="formType=='modify'" />
<el-input v-model="form.configuration.port" autocomplete="off" />
</el-form-item>
<el-form-item>