Search in sources :

Example 1 with AddMultiSourceRuleRequest

use of com.webank.wedatasphere.qualitis.rule.request.multi.AddMultiSourceRuleRequest in project Qualitis by WeBankFinTech.

the class RuleNodeServiceImpl method copyRuleByRuleGroupId.

@Override
public GeneralResponse<RuleResponse> copyRuleByRuleGroupId(CopyRuleRequest request) throws UnExpectedRequestException, PermissionDeniedRequestException {
    CopyRuleRequest.checkRequest(request);
    Long ruleGroupId = request.getSourceRuleGroupId();
    RuleGroup ruleGroupInDb = ruleGroupDao.findById(request.getSourceRuleGroupId());
    int totalFinish = 0;
    RuleGroup targetRuleGroup;
    if (request.getTargetRuleGroupId() != null) {
        RuleGroup targetRuleGroupInDb = ruleGroupDao.findById(request.getTargetRuleGroupId());
        if (targetRuleGroupInDb != null) {
            targetRuleGroup = targetRuleGroupInDb;
        } else {
            throw new UnExpectedRequestException("Rule group id is illegal.");
        }
    } else {
        RuleGroup currentRuleGroup = new RuleGroup("Group_" + UUID.randomUUID().toString().replace("-", ""), request.getTargetProjectId() != null ? request.getTargetProjectId() : ruleGroupInDb.getProjectId());
        currentRuleGroup.setVersion(request.getVersion());
        targetRuleGroup = ruleGroupDao.saveRuleGroup(currentRuleGroup);
    }
    if (ruleGroupId != null) {
        LOGGER.info("Start to copy rules of rule group[ID=" + ruleGroupId + "].");
        if (ruleGroupInDb == null) {
            throw new UnExpectedRequestException("Rule group {&DOES_NOT_EXIST}");
        }
        List<Rule> rules = ruleDao.findByRuleGroup(ruleGroupInDb);
        for (Rule rule : rules) {
            switch(rule.getRuleType().intValue()) {
                case 1:
                    AddRuleRequest addRuleRequest = constructSingleRequest(rule, targetRuleGroup);
                    ruleService.addRuleForOuter(addRuleRequest, request.getCreateUser());
                    totalFinish++;
                    break;
                case 2:
                    AddCustomRuleRequest addCustomRuleRequest = constructCustomRequest(rule, targetRuleGroup);
                    customRuleService.addRuleForOuter(addCustomRuleRequest, request.getCreateUser());
                    totalFinish++;
                    break;
                case 3:
                    AddMultiSourceRuleRequest addMultiSourceRuleRequest = constructMultiRequest(rule, targetRuleGroup);
                    addMultiSourceRuleRequest.setLoginUser(request.getCreateUser());
                    multiSourceRuleService.addRuleForOuter(addMultiSourceRuleRequest, false);
                    totalFinish++;
                    break;
                case 4:
                    AddFileRuleRequest addFileRuleRequest = constructFileRequest(rule, targetRuleGroup);
                    fileRuleService.addRuleForOuter(addFileRuleRequest, request.getCreateUser());
                    totalFinish++;
                    break;
                default:
            }
        }
        if (totalFinish != rules.size()) {
            return new GeneralResponse<>("200", "{&COPY_RULE_FAILED}", new RuleResponse(targetRuleGroup.getId()));
        }
    } else if (CollectionUtils.isNotEmpty(request.getSourceRuleIdList())) {
    }
    return new GeneralResponse<>("200", "{&COPY_RULE_SUCCESSFULLY}", new RuleResponse(targetRuleGroup.getId()));
}
Also used : AddRuleRequest(com.webank.wedatasphere.qualitis.rule.request.AddRuleRequest) GeneralResponse(com.webank.wedatasphere.qualitis.response.GeneralResponse) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) AddCustomRuleRequest(com.webank.wedatasphere.qualitis.rule.request.AddCustomRuleRequest) AddFileRuleRequest(com.webank.wedatasphere.qualitis.rule.request.AddFileRuleRequest) RuleResponse(com.webank.wedatasphere.qualitis.rule.response.RuleResponse) Rule(com.webank.wedatasphere.qualitis.rule.entity.Rule) RuleGroup(com.webank.wedatasphere.qualitis.rule.entity.RuleGroup) AddMultiSourceRuleRequest(com.webank.wedatasphere.qualitis.rule.request.multi.AddMultiSourceRuleRequest)

Example 2 with AddMultiSourceRuleRequest

use of com.webank.wedatasphere.qualitis.rule.request.multi.AddMultiSourceRuleRequest in project Qualitis by WeBankFinTech.

the class RuleNodeServiceImpl method constructMultiRequest.

private AddMultiSourceRuleRequest constructMultiRequest(Rule rule, RuleGroup ruleGroup) {
    AddMultiSourceRuleRequest addMultiSourceRuleRequest = new AddMultiSourceRuleRequest();
    String newVersion = ruleGroup.getVersion();
    if (StringUtils.isEmpty(newVersion)) {
        String newRuleName = rule.getName() + "_copy_" + ruleGroup.getId();
        LOGGER.info("Multi rule start to be copied. Copied rule name: " + newRuleName);
        addMultiSourceRuleRequest.setRuleName(newRuleName);
        if (StringUtils.isNotBlank(rule.getCnName())) {
            addMultiSourceRuleRequest.setRuleCnName(rule.getCnName() + "_副本");
        }
    } else {
        String oldVersion = rule.getRuleGroup().getVersion();
        LOGGER.info("Multi rule start to be copied. Copied rule name: " + rule.getName() + "_" + ruleGroup.getVersion());
        if (StringUtils.isNotBlank(oldVersion) && rule.getName().endsWith(oldVersion)) {
            addMultiSourceRuleRequest.setRuleName(rule.getName().replace(oldVersion, newVersion));
            if (StringUtils.isNotBlank(rule.getCnName())) {
                addMultiSourceRuleRequest.setRuleCnName(rule.getCnName().replace(oldVersion, newVersion));
            }
        } else {
            addMultiSourceRuleRequest.setRuleName(rule.getName() + "_" + newVersion);
            if (StringUtils.isNotBlank(rule.getCnName())) {
                addMultiSourceRuleRequest.setRuleCnName(rule.getCnName() + "_" + newVersion);
            }
        }
    }
    String ruleDetail = rule.getDetail();
    String clusterName = rule.getRuleDataSources().iterator().next().getClusterName();
    addMultiSourceRuleRequest.setAbortOnFailure(rule.getAbortOnFailure());
    addMultiSourceRuleRequest.setClusterName(clusterName);
    addMultiSourceRuleRequest.setRuleDetail(ruleDetail);
    addMultiSourceRuleRequest.setCsId(rule.getCsId());
    addMultiSourceRuleRequest.setSpecifyStaticStartupParam(rule.getSpecifyStaticStartupParam());
    addMultiSourceRuleRequest.setDeleteFailCheckResult(rule.getDeleteFailCheckResult());
    addMultiSourceRuleRequest.setMultiSourceRuleTemplateId(rule.getTemplate().getId());
    addMultiSourceRuleRequest.setStaticStartupParam(rule.getStaticStartupParam());
    addMultiSourceRuleRequest.setProjectId(ruleGroup.getProjectId());
    addMultiSourceRuleRequest.setRuleGroupId(ruleGroup.getId());
    List<RuleVariable> filterRuleVariable = rule.getRuleVariables().stream().filter(ruleVariable -> ruleVariable.getTemplateMidTableInputMeta().getInputType().equals(TemplateInputTypeEnum.CONDITION.getCode())).collect(Collectors.toList());
    if (filterRuleVariable != null && filterRuleVariable.size() != 0) {
        addMultiSourceRuleRequest.setFilter(filterRuleVariable.iterator().next().getValue());
    }
    // Data source request
    for (RuleDataSource ruleDataSource : rule.getRuleDataSources()) {
        String databaseName = ruleDataSource.getDbName();
        String tableName = ruleDataSource.getTableName();
        String filter = ruleDataSource.getFilter();
        Integer datasourceIndex = ruleDataSource.getDatasourceIndex();
        MultiDataSourceConfigRequest dataSourceConfigRequest = new MultiDataSourceConfigRequest();
        dataSourceConfigRequest.setDbName(databaseName);
        dataSourceConfigRequest.setTableName(tableName);
        dataSourceConfigRequest.setFilter(filter);
        dataSourceConfigRequest.setProxyUser(ruleDataSource.getProxyUser());
        if (ruleDataSource.getLinkisDataSourceId() != null) {
            dataSourceConfigRequest.setLinkisDataSourceType(TemplateDataSourceTypeEnum.getMessage(ruleDataSource.getDatasourceType()));
            dataSourceConfigRequest.setLinkisDataSourceName(ruleDataSource.getLinkisDataSourceName());
            dataSourceConfigRequest.setLinkisDataSourceId(ruleDataSource.getLinkisDataSourceId());
        }
        if (datasourceIndex == 0) {
            addMultiSourceRuleRequest.setSource(dataSourceConfigRequest);
        } else {
            addMultiSourceRuleRequest.setTarget(dataSourceConfigRequest);
        }
    }
    // Mapping
    List<MultiDataSourceJoinConfigRequest> mappings = new ArrayList<>();
    for (RuleDataSourceMapping mapping : rule.getRuleDataSourceMappings()) {
        MultiDataSourceJoinConfigRequest multiDataSourceJoinConfigRequest = new MultiDataSourceJoinConfigRequest();
        multiDataSourceJoinConfigRequest.setOperation(mapping.getOperation());
        multiDataSourceJoinConfigRequest.setLeftStatement(mapping.getLeftStatement());
        multiDataSourceJoinConfigRequest.setRightStatement(mapping.getRightStatement());
        List<MultiDataSourceJoinColumnRequest> left = getMultiDataSourceJoinColumnRequest(mapping.getLeftColumnNames(), mapping.getLeftColumnTypes());
        List<MultiDataSourceJoinColumnRequest> right = getMultiDataSourceJoinColumnRequest(mapping.getRightColumnNames(), mapping.getLeftColumnTypes());
        multiDataSourceJoinConfigRequest.setLeft(left);
        multiDataSourceJoinConfigRequest.setRight(right);
        mappings.add(multiDataSourceJoinConfigRequest);
    }
    addMultiSourceRuleRequest.setMappings(mappings);
    List<AlarmConfigRequest> alarmConfigRequests = constructAlarmConfigRequest(rule.getAlarmConfigs());
    addMultiSourceRuleRequest.setAlarm(true);
    addMultiSourceRuleRequest.setAlarmVariable(alarmConfigRequests);
    return addMultiSourceRuleRequest;
}
Also used : RuleDataSourceMappingDao(com.webank.wedatasphere.qualitis.rule.dao.RuleDataSourceMappingDao) Arrays(java.util.Arrays) StringUtils(org.apache.commons.lang.StringUtils) TemplateOutputMetaService(com.webank.wedatasphere.qualitis.rule.service.TemplateOutputMetaService) Autowired(org.springframework.beans.factory.annotation.Autowired) JsonProcessingException(org.codehaus.jackson.JsonProcessingException) GeneralResponse(com.webank.wedatasphere.qualitis.response.GeneralResponse) AlarmConfig(com.webank.wedatasphere.qualitis.rule.entity.AlarmConfig) RuleMetricDao(com.webank.wedatasphere.qualitis.dao.RuleMetricDao) DeleteRuleRequest(com.webank.wedatasphere.qualitis.rule.request.DeleteRuleRequest) OuterWorkflowService(com.webank.wedatasphere.qualitis.project.service.OuterWorkflowService) MultiDataSourceConfigRequest(com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceConfigRequest) RuleNodeRequests(com.webank.wedatasphere.qualitis.rule.request.RuleNodeRequests) FileOutputUnitEnum(com.webank.wedatasphere.qualitis.rule.constant.FileOutputUnitEnum) TemplateMidTableInputMeta(com.webank.wedatasphere.qualitis.rule.entity.TemplateMidTableInputMeta) AddMultiSourceRuleRequest(com.webank.wedatasphere.qualitis.rule.request.multi.AddMultiSourceRuleRequest) Set(java.util.Set) TemplateDataSourceType(com.webank.wedatasphere.qualitis.rule.entity.TemplateDataSourceType) DataSourceRequest(com.webank.wedatasphere.qualitis.rule.request.DataSourceRequest) TemplateMidTableInputMetaService(com.webank.wedatasphere.qualitis.rule.service.TemplateMidTableInputMetaService) TypeReference(org.codehaus.jackson.type.TypeReference) RuleDataSourceMappingService(com.webank.wedatasphere.qualitis.rule.service.RuleDataSourceMappingService) RuleNodeRequest(com.webank.wedatasphere.qualitis.rule.request.RuleNodeRequest) TemplateStatisticsInputMeta(com.webank.wedatasphere.qualitis.rule.entity.TemplateStatisticsInputMeta) FileAlarmConfigRequest(com.webank.wedatasphere.qualitis.rule.request.FileAlarmConfigRequest) TemplateArgumentRequest(com.webank.wedatasphere.qualitis.rule.request.TemplateArgumentRequest) Project(com.webank.wedatasphere.qualitis.project.entity.Project) RuleDataSourceDao(com.webank.wedatasphere.qualitis.rule.dao.RuleDataSourceDao) Rule(com.webank.wedatasphere.qualitis.rule.entity.Rule) ProjectDao(com.webank.wedatasphere.qualitis.project.dao.ProjectDao) ArrayList(java.util.ArrayList) TemplateDataSourceTypeDao(com.webank.wedatasphere.qualitis.rule.dao.TemplateDataSourceTypeDao) CheckTemplateEnum(com.webank.wedatasphere.qualitis.rule.constant.CheckTemplateEnum) Service(org.springframework.stereotype.Service) TemplateStatisticsInputMetaService(com.webank.wedatasphere.qualitis.rule.service.TemplateStatisticsInputMetaService) RuleTemplateService(com.webank.wedatasphere.qualitis.rule.service.RuleTemplateService) RuleVariableService(com.webank.wedatasphere.qualitis.rule.service.RuleVariableService) RoleService(com.webank.wedatasphere.qualitis.service.RoleService) DataSourceColumnRequest(com.webank.wedatasphere.qualitis.rule.request.DataSourceColumnRequest) CustomAlarmConfigRequest(com.webank.wedatasphere.qualitis.rule.request.CustomAlarmConfigRequest) IOException(java.io.IOException) FileRuleService(com.webank.wedatasphere.qualitis.rule.service.FileRuleService) TemplateInputTypeEnum(com.webank.wedatasphere.qualitis.rule.constant.TemplateInputTypeEnum) MultiSourceRuleService(com.webank.wedatasphere.qualitis.rule.service.MultiSourceRuleService) TemplateDataSourceTypeEnum(com.webank.wedatasphere.qualitis.rule.constant.TemplateDataSourceTypeEnum) RuleMetricDepartmentUserDao(com.webank.wedatasphere.qualitis.dao.RuleMetricDepartmentUserDao) UserDao(com.webank.wedatasphere.qualitis.dao.UserDao) RuleNodeService(com.webank.wedatasphere.qualitis.rule.service.RuleNodeService) ObjectMapper(org.codehaus.jackson.map.ObjectMapper) LocalConfig(com.webank.wedatasphere.qualitis.LocalConfig) LoggerFactory(org.slf4j.LoggerFactory) TemplateMidTableUtil(com.webank.wedatasphere.qualitis.rule.util.TemplateMidTableUtil) SemanticException(org.apache.hadoop.hive.ql.parse.SemanticException) JsonNode(org.codehaus.jackson.JsonNode) PermissionDeniedRequestException(com.webank.wedatasphere.qualitis.exception.PermissionDeniedRequestException) RuleDataSource(com.webank.wedatasphere.qualitis.rule.entity.RuleDataSource) ParseException(org.apache.hadoop.hive.ql.parse.ParseException) RuleGroupDao(com.webank.wedatasphere.qualitis.rule.dao.RuleGroupDao) ProjectService(com.webank.wedatasphere.qualitis.project.service.ProjectService) AddCustomRuleRequest(com.webank.wedatasphere.qualitis.rule.request.AddCustomRuleRequest) AlarmConfigRequest(com.webank.wedatasphere.qualitis.rule.request.AlarmConfigRequest) ExcelMultiTemplateRuleByProject(com.webank.wedatasphere.qualitis.project.excel.ExcelMultiTemplateRuleByProject) TemplateOutputMetaDao(com.webank.wedatasphere.qualitis.rule.dao.TemplateOutputMetaDao) MappingOperationEnum(com.webank.wedatasphere.qualitis.rule.constant.MappingOperationEnum) InputActionStepEnum(com.webank.wedatasphere.qualitis.rule.constant.InputActionStepEnum) CustomRuleService(com.webank.wedatasphere.qualitis.rule.service.CustomRuleService) UuidGenerator(com.webank.wedatasphere.qualitis.util.UuidGenerator) CopyRuleRequest(com.webank.wedatasphere.qualitis.rule.request.CopyRuleRequest) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) RuleDataSourceMapping(com.webank.wedatasphere.qualitis.rule.entity.RuleDataSourceMapping) MetaDataAcquireFailedException(com.webank.wedatasphere.qualitis.metadata.exception.MetaDataAcquireFailedException) RuleService(com.webank.wedatasphere.qualitis.rule.service.RuleService) List(java.util.List) RoleNotFoundException(javax.management.relation.RoleNotFoundException) AlarmConfigDao(com.webank.wedatasphere.qualitis.rule.dao.AlarmConfigDao) CommonChecker(com.webank.wedatasphere.qualitis.project.request.CommonChecker) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) RuleNodeResponses(com.webank.wedatasphere.qualitis.rule.response.RuleNodeResponses) RuleNodeResponse(com.webank.wedatasphere.qualitis.rule.response.RuleNodeResponse) AlarmConfigService(com.webank.wedatasphere.qualitis.rule.service.AlarmConfigService) RuleGroup(com.webank.wedatasphere.qualitis.rule.entity.RuleGroup) SpecCharEnum(com.webank.wedatasphere.qualitis.constant.SpecCharEnum) RuleVariableDao(com.webank.wedatasphere.qualitis.rule.dao.RuleVariableDao) RuleVariable(com.webank.wedatasphere.qualitis.rule.entity.RuleVariable) RuleDataSourceService(com.webank.wedatasphere.qualitis.rule.service.RuleDataSourceService) UserRoleDao(com.webank.wedatasphere.qualitis.dao.UserRoleDao) AddFileRuleRequest(com.webank.wedatasphere.qualitis.rule.request.AddFileRuleRequest) HashSet(java.util.HashSet) User(com.webank.wedatasphere.qualitis.entity.User) CollectionUtils(org.apache.commons.collections.CollectionUtils) Propagation(org.springframework.transaction.annotation.Propagation) RuleTemplateDao(com.webank.wedatasphere.qualitis.rule.dao.RuleTemplateDao) TemplateOutputMeta(com.webank.wedatasphere.qualitis.rule.entity.TemplateOutputMeta) CompareTypeEnum(com.webank.wedatasphere.qualitis.rule.constant.CompareTypeEnum) MultiDataSourceJoinColumnRequest(com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceJoinColumnRequest) AddRuleRequest(com.webank.wedatasphere.qualitis.rule.request.AddRuleRequest) Logger(org.slf4j.Logger) ExcelTemplateFileRuleByProject(com.webank.wedatasphere.qualitis.project.excel.ExcelTemplateFileRuleByProject) Iterator(java.util.Iterator) RuleMetric(com.webank.wedatasphere.qualitis.entity.RuleMetric) Template(com.webank.wedatasphere.qualitis.rule.entity.Template) ProjectTypeEnum(com.webank.wedatasphere.qualitis.project.constant.ProjectTypeEnum) RuleResponse(com.webank.wedatasphere.qualitis.rule.response.RuleResponse) FunctionTypeEnum(com.webank.wedatasphere.qualitis.rule.constant.FunctionTypeEnum) UserService(com.webank.wedatasphere.qualitis.service.UserService) FileOutputNameEnum(com.webank.wedatasphere.qualitis.rule.constant.FileOutputNameEnum) RuleTypeEnum(com.webank.wedatasphere.qualitis.rule.constant.RuleTypeEnum) RuleDao(com.webank.wedatasphere.qualitis.rule.dao.RuleDao) MultiDataSourceJoinConfigRequest(com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceJoinConfigRequest) ModifyRuleRequest(com.webank.wedatasphere.qualitis.rule.request.ModifyRuleRequest) Comparator(java.util.Comparator) StringEscapeUtils(org.apache.commons.lang.StringEscapeUtils) Transactional(org.springframework.transaction.annotation.Transactional) RuleDataSourceMapping(com.webank.wedatasphere.qualitis.rule.entity.RuleDataSourceMapping) RuleDataSource(com.webank.wedatasphere.qualitis.rule.entity.RuleDataSource) MultiDataSourceJoinColumnRequest(com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceJoinColumnRequest) ArrayList(java.util.ArrayList) MultiDataSourceJoinConfigRequest(com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceJoinConfigRequest) FileAlarmConfigRequest(com.webank.wedatasphere.qualitis.rule.request.FileAlarmConfigRequest) CustomAlarmConfigRequest(com.webank.wedatasphere.qualitis.rule.request.CustomAlarmConfigRequest) AlarmConfigRequest(com.webank.wedatasphere.qualitis.rule.request.AlarmConfigRequest) MultiDataSourceConfigRequest(com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceConfigRequest) AddMultiSourceRuleRequest(com.webank.wedatasphere.qualitis.rule.request.multi.AddMultiSourceRuleRequest) RuleVariable(com.webank.wedatasphere.qualitis.rule.entity.RuleVariable)

Example 3 with AddMultiSourceRuleRequest

use of com.webank.wedatasphere.qualitis.rule.request.multi.AddMultiSourceRuleRequest in project Qualitis by WeBankFinTech.

the class MetaDataServiceImpl method constructRequest.

private AddMultiSourceRuleRequest constructRequest(MulDbRequest request, FilterRequest filterRequest, String currentSourceTable, String currentTargetTable, int index, int total, String loginUser) throws UnExpectedRequestException, MetaDataAcquireFailedException, IOException {
    LOGGER.info("Start to construct add multi source rule request.");
    // rule basic info.
    AddMultiSourceRuleRequest addMultiSourceRuleRequest = new AddMultiSourceRuleRequest();
    basicInfo(addMultiSourceRuleRequest, request, index, total);
    MultiDataSourceConfigRequest sourceConfigRequest = new MultiDataSourceConfigRequest();
    sourceConfigRequest.setLinkisDataSourceName(request.getSourceLinkisDataSourceName());
    sourceConfigRequest.setLinkisDataSourceType(request.getSourceLinkisDataSourceType());
    sourceConfigRequest.setLinkisDataSourceId(request.getSourceLinkisDataSourceId());
    sourceConfigRequest.setProxyUser(request.getProxyUser());
    sourceConfigRequest.setDbName(request.getSourceDb());
    sourceConfigRequest.setContextService(false);
    MultiDataSourceConfigRequest targetConfigRequest = new MultiDataSourceConfigRequest();
    targetConfigRequest.setLinkisDataSourceName(request.getTargetLinkisDataSourceName());
    targetConfigRequest.setLinkisDataSourceType(request.getTargetLinkisDataSourceType());
    targetConfigRequest.setLinkisDataSourceId(request.getTargetLinkisDataSourceId());
    targetConfigRequest.setProxyUser(request.getProxyUser());
    targetConfigRequest.setDbName(request.getTargetDb());
    targetConfigRequest.setContextService(false);
    if (filterRequest == null) {
        // source table and target table
        sourceConfigRequest.setTableName(currentSourceTable);
        sourceConfigRequest.setFilter("true");
        targetConfigRequest.setTableName(currentTargetTable);
        targetConfigRequest.setFilter("true");
        addMultiSourceRuleRequest.setMultiSourceRuleTemplateId(20L);
        List<AlarmConfigRequest> alarmConfigRequests = new ArrayList<>();
        alarmConfigRequests.add(new AlarmConfigRequest(645L, CheckTemplateEnum.FIXED_VALUE.getCode(), CompareTypeEnum.EQUAL.getCode(), 0.0));
        addMultiSourceRuleRequest.setAlarmVariable(alarmConfigRequests);
    } else {
        sourceConfigRequest.setTableName(filterRequest.getSourceTable());
        if (StringUtils.isNotBlank(filterRequest.getSourceFilter())) {
            sourceConfigRequest.setFilter("! (" + filterRequest.getSourceFilter() + ")");
        } else {
            sourceConfigRequest.setFilter("true");
        }
        targetConfigRequest.setTableName(filterRequest.getTargetTable());
        if (StringUtils.isNotBlank(filterRequest.getTargetFilter())) {
            targetConfigRequest.setFilter("! (" + filterRequest.getTargetFilter() + ")");
        } else {
            targetConfigRequest.setFilter("true");
        }
        addMultiSourceRuleRequest.setMultiSourceRuleTemplateId(17L);
        List<AlarmConfigRequest> alarmConfigRequests = new ArrayList<>();
        alarmConfigRequests.add(new AlarmConfigRequest(33L, CheckTemplateEnum.FIXED_VALUE.getCode(), CompareTypeEnum.EQUAL.getCode(), 0.0));
        addMultiSourceRuleRequest.setAlarmVariable(alarmConfigRequests);
    }
    addMultiSourceRuleRequest.setSource(sourceConfigRequest);
    addMultiSourceRuleRequest.setTarget(targetConfigRequest);
    // All fields mappings
    LOGGER.info("Start to get all fields with source database's table and target database's table.");
    List<ColumnInfoDetail> sourceFields;
    List<ColumnInfoDetail> targetFields;
    if (request.getSourceLinkisDataSourceId() == null) {
        GetUserColumnByTableIdRequest getUserColumnSourceRequest = new GetUserColumnByTableIdRequest(0, Integer.MAX_VALUE, request.getClusterName(), request.getSourceDb(), filterRequest == null ? currentSourceTable : filterRequest.getSourceTable());
        getUserColumnSourceRequest.setProxyUser(request.getProxyUser());
        getUserColumnSourceRequest.setLoginUser(loginUser);
        sourceFields = getUserColumnByTableId(getUserColumnSourceRequest).getData().getData();
    } else {
        sourceFields = getColumnsByDataSource(request.getClusterName(), request.getProxyUser(), request.getSourceLinkisDataSourceId(), request.getSourceDb(), currentSourceTable).getData().getData();
    }
    if (request.getTargetLinkisDataSourceId() == null) {
        GetUserColumnByTableIdRequest getUserColumnTargetRequest = new GetUserColumnByTableIdRequest(0, Integer.MAX_VALUE, request.getClusterName(), request.getTargetDb(), filterRequest == null ? currentTargetTable : filterRequest.getTargetTable());
        getUserColumnTargetRequest.setProxyUser(request.getProxyUser());
        getUserColumnTargetRequest.setLoginUser(loginUser);
        targetFields = getUserColumnByTableId(getUserColumnTargetRequest).getData().getData();
    } else {
        targetFields = getColumnsByDataSource(request.getClusterName(), request.getProxyUser(), request.getTargetLinkisDataSourceId(), request.getTargetDb(), currentTargetTable).getData().getData();
    }
    if (CollectionUtils.isEmpty(sourceFields) || CollectionUtils.isEmpty(targetFields)) {
        throw new UnExpectedRequestException("There is table which has none field");
    }
    LOGGER.info("Success to get all fields with source database's table and target database's table.");
    // Sorted columns.
    Collections.sort(sourceFields, new Comparator<ColumnInfoDetail>() {

        @Override
        public int compare(ColumnInfoDetail front, ColumnInfoDetail back) {
            return front.getFieldName().compareTo(back.getFieldName());
        }
    });
    Collections.sort(targetFields, new Comparator<ColumnInfoDetail>() {

        @Override
        public int compare(ColumnInfoDetail front, ColumnInfoDetail back) {
            return front.getFieldName().compareTo(back.getFieldName());
        }
    });
    String sourceFieldStr = sourceFields.stream().map(ColumnInfoDetail::getFieldName).collect(Collectors.joining(SpecCharEnum.COMMA.getValue()));
    String sourceFieldTypeStr = sourceFields.stream().map(ColumnInfoDetail::getDataType).collect(Collectors.joining(SpecCharEnum.COMMA.getValue()));
    String targetFieldStr = targetFields.stream().map(ColumnInfoDetail::getFieldName).collect(Collectors.joining(SpecCharEnum.COMMA.getValue()));
    String targetFieldTypeStr = targetFields.stream().map(ColumnInfoDetail::getDataType).collect(Collectors.joining(SpecCharEnum.COMMA.getValue()));
    if (sourceFields.size() == 0 || targetFields.size() == 0 || sourceFields.size() != targetFields.size() || !sourceFieldStr.equals(targetFieldStr) || !sourceFieldTypeStr.equals(targetFieldTypeStr)) {
        throw new UnExpectedRequestException("Create multi-db rules failed, because the fields' name of table is different.");
    }
    List<MultiDataSourceJoinConfigRequest> mappings = new ArrayList<>(sourceFields.size());
    for (int j = 0; j < sourceFields.size() && j < targetFields.size(); j++) {
        ColumnInfoDetail currentSourceField = sourceFields.get(j);
        ColumnInfoDetail currentTargetField = targetFields.get(j);
        if (filterRequest != null && CollectionUtils.isNotEmpty(filterRequest.getFilterColumnList()) && filterRequest.getFilterColumnList().contains(currentSourceField.getFieldName())) {
            continue;
        }
        if (currentSourceField.getFieldName().equals(currentTargetField.getFieldName()) && currentSourceField.getDataType().equals(currentTargetField.getDataType())) {
            // TODO: continue
            MultiDataSourceJoinConfigRequest multiDataSourceJoinConfigRequest = new MultiDataSourceJoinConfigRequest();
            MultiDataSourceJoinColumnRequest leftJoinColumnRequest = new MultiDataSourceJoinColumnRequest("tmp1.".concat(currentSourceField.getFieldName()), currentSourceField.getDataType());
            MultiDataSourceJoinColumnRequest rightJoinColumnRequest = new MultiDataSourceJoinColumnRequest("tmp2.".concat(currentTargetField.getFieldName()), currentTargetField.getDataType());
            multiDataSourceJoinConfigRequest.setOperation(MappingOperationEnum.EQUAL.getCode());
            multiDataSourceJoinConfigRequest.setLeft(Arrays.asList(leftJoinColumnRequest));
            multiDataSourceJoinConfigRequest.setRight(Arrays.asList(rightJoinColumnRequest));
            multiDataSourceJoinConfigRequest.setLeftStatement("tmp1.".concat(currentSourceField.getFieldName()));
            multiDataSourceJoinConfigRequest.setRightStatement("tmp2.".concat(currentTargetField.getFieldName()));
            mappings.add(multiDataSourceJoinConfigRequest);
        } else {
            throw new UnExpectedRequestException("Create multi-db rules failed, because the fields' name of tables is different");
        }
    }
    addMultiSourceRuleRequest.setMappings(mappings);
    addMultiSourceRuleRequest.setLoginUser(loginUser);
    LOGGER.info("Success to construct add multi source rule request. Request[{}]", new ObjectMapper().writeValueAsString(addMultiSourceRuleRequest));
    return addMultiSourceRuleRequest;
}
Also used : UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) MultiDataSourceJoinColumnRequest(com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceJoinColumnRequest) ArrayList(java.util.ArrayList) ColumnInfoDetail(com.webank.wedatasphere.qualitis.metadata.response.column.ColumnInfoDetail) MultiDataSourceJoinConfigRequest(com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceJoinConfigRequest) AlarmConfigRequest(com.webank.wedatasphere.qualitis.rule.request.AlarmConfigRequest) MultiDataSourceConfigRequest(com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceConfigRequest) GetUserColumnByTableIdRequest(com.webank.wedatasphere.qualitis.request.GetUserColumnByTableIdRequest) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) AddMultiSourceRuleRequest(com.webank.wedatasphere.qualitis.rule.request.multi.AddMultiSourceRuleRequest)

Example 4 with AddMultiSourceRuleRequest

use of com.webank.wedatasphere.qualitis.rule.request.multi.AddMultiSourceRuleRequest in project Qualitis by WeBankFinTech.

the class MetaDataServiceImpl method addMultiDbRules.

@Override
@Transactional(rollbackFor = { Exception.class, UnExpectedRequestException.class })
public String addMultiDbRules(MulDbRequest request) throws UnExpectedRequestException, MetaDataAcquireFailedException {
    MulDbRequest.checkRequst(request);
    String loginUser = HttpUtils.getUserName(httpServletRequest);
    LOGGER.info("Start to get all tables with source database and target database.");
    List<String> sourceTableName = new ArrayList<>();
    List<String> targetTableName = new ArrayList<>();
    if (request.getSourceLinkisDataSourceId() == null) {
        GetUserTableByDbIdRequest sourceRequest = new GetUserTableByDbIdRequest(0, Integer.MAX_VALUE, request.getClusterName(), request.getSourceDb());
        sourceRequest.setProxyUser(request.getProxyUser());
        GeneralResponse<GetAllResponse<TableInfoDetail>> sourceTableInfos = getUserTableByDbId(sourceRequest);
        if (sourceTableInfos.getData().getTotal() <= 0) {
            throw new UnExpectedRequestException("Source database has no tables.");
        }
        sourceTableName.addAll(sourceTableInfos.getData().getData().stream().map(TableInfoDetail::getTableName).collect(Collectors.toList()));
    } else {
        Map response = getTablesByDataSource(request.getClusterName(), request.getProxyUser(), request.getSourceLinkisDataSourceId(), request.getSourceDb());
        List<String> tables = (List<String>) response.get("tables");
        for (String table : tables) {
            sourceTableName.add(table);
        }
    }
    if (request.getTargetLinkisDataSourceId() == null) {
        GetUserTableByDbIdRequest targetRequest = new GetUserTableByDbIdRequest(0, Integer.MAX_VALUE, request.getClusterName(), request.getTargetDb());
        targetRequest.setProxyUser(request.getProxyUser());
        GeneralResponse<GetAllResponse<TableInfoDetail>> targetTableInfos = getUserTableByDbId(targetRequest);
        if (targetTableInfos.getData().getTotal() <= 0) {
            throw new UnExpectedRequestException("Target database has no tables.");
        }
        targetTableName.addAll(targetTableInfos.getData().getData().stream().map(TableInfoDetail::getTableName).collect(Collectors.toList()));
    } else {
        Map response = getTablesByDataSource(request.getClusterName(), request.getProxyUser(), request.getTargetLinkisDataSourceId(), request.getTargetDb());
        List<String> tables = (List<String>) response.get("tables");
        for (String table : tables) {
            targetTableName.add(table);
        }
    }
    // Collect the table with the same name that exists in the source database and the target database.
    sourceTableName.retainAll(targetTableName);
    Set<String> ruleFailedTable = new HashSet<>();
    Long projectId = request.getProjectId();
    List<String> ruleTables = new ArrayList<>(ruleDataSourceDao.findByProjectId(projectId).stream().map(RuleDataSource::getTableName).distinct().collect(Collectors.toList()));
    // Filter tables for which rules have been created.
    sourceTableName = sourceTableName.stream().filter(tableName -> !ruleTables.contains(tableName)).collect(Collectors.toList());
    // Rule name index starts with the last created rule.
    int ruleIndex = ruleDao.findByProject(projectDao.findById(projectId)).size();
    // Filter tables with black list.
    sourceTableName = filterTablesWithBlackList(request.getBlackList(), sourceTableName);
    // White list.
    List<String> whiteList = request.getWhiteList();
    // Filter special table to compare with accuracy template.
    List<FilterRequest> filterRequests = request.getFilterRequests();
    List<FilterRequest> sameTableFilterRequests = filterRequests.stream().filter(filterRequest -> filterRequest.getSourceTable().equals(filterRequest.getTargetTable())).collect(Collectors.toList());
    List<String> filterSameTableName = sameTableFilterRequests.stream().map(FilterRequest::getSourceTable).collect(Collectors.toList());
    sourceTableName.removeAll(filterSameTableName);
    filterRequests.removeAll(sameTableFilterRequests);
    List<String> filterDiffTableName = filterRequests.stream().map(filterRequest -> filterRequest.getSourceTable() + SpecCharEnum.COLON.getValue() + filterRequest.getTargetTable()).collect(Collectors.toList());
    whiteList.removeAll(filterDiffTableName);
    filterRequests.addAll(sameTableFilterRequests);
    // Check flag: create rules in a loop, and only do permission verification for the first time.
    boolean check = true;
    int sourceTableSize = sourceTableName.size();
    int filterRequestsSize = filterRequests.size();
    int total = ruleIndex + sourceTableSize + whiteList.size() + filterRequestsSize;
    int i = ruleIndex;
    for (; i < ruleIndex + sourceTableSize; i++) {
        String currentSameTable = sourceTableName.get(i - ruleIndex);
        try {
            AddMultiSourceRuleRequest addMultiSourceRuleRequest = constructRequest(request, null, currentSameTable, currentSameTable, i, total, loginUser);
            LOGGER.info("Start to add {}th multi source rule.", i);
            if (i > 0) {
                check = false;
            }
            multiSourceRuleService.addMultiSourceRule(addMultiSourceRuleRequest, check);
        } catch (Exception e) {
            LOGGER.error("One of rule failed to add, rule index:[{}], table name: [{}], exception:{}", i, currentSameTable, e.getMessage());
            ruleFailedTable.add(currentSameTable);
        }
        LOGGER.info("Finish to add {}th multi source rule.", i);
    }
    // With white list.
    withWhiteListAndFilterRequest(i, ruleIndex, sourceTableSize, total, whiteList, filterRequests, request, loginUser, check);
    // Record the table that failed to create a rule.
    saveRuleFailedTableInLabel(ruleFailedTable, projectId);
    // projectEventService.record(projectId, loginUser, "create multi-source rule with dbs", "Success: " + (total - ruleFailedTable.size()) + "; Failed: " + ruleFailedTable.size(), EventTypeEnum.MODIFY_PROJECT.getCode());
    return request.getSourceDb() + " vs " + request.getSourceDb() + ": " + "{&CONTINUE_CREATE_RULES}";
}
Also used : GetUserTableByDbIdRequest(com.webank.wedatasphere.qualitis.request.GetUserTableByDbIdRequest) Arrays(java.util.Arrays) StringUtils(org.apache.commons.lang.StringUtils) LoggerFactory(org.slf4j.LoggerFactory) GetUserColumnByCsRequest(com.webank.wedatasphere.qualitis.metadata.request.GetUserColumnByCsRequest) Autowired(org.springframework.beans.factory.annotation.Autowired) RuleDataSource(com.webank.wedatasphere.qualitis.rule.entity.RuleDataSource) GeneralResponse(com.webank.wedatasphere.qualitis.response.GeneralResponse) ClusterInfoDao(com.webank.wedatasphere.qualitis.dao.ClusterInfoDao) HttpUtils(com.webank.wedatasphere.qualitis.util.HttpUtils) Map(java.util.Map) MultiDataSourceConfigRequest(com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceConfigRequest) GetClusterByUserRequest(com.webank.wedatasphere.qualitis.metadata.request.GetClusterByUserRequest) ProjectService(com.webank.wedatasphere.qualitis.project.service.ProjectService) GetAllResponse(com.webank.wedatasphere.qualitis.response.GetAllResponse) AlarmConfigRequest(com.webank.wedatasphere.qualitis.rule.request.AlarmConfigRequest) ProjectEventService(com.webank.wedatasphere.qualitis.project.service.ProjectEventService) GetUserDbByClusterRequest(com.webank.wedatasphere.qualitis.request.GetUserDbByClusterRequest) GetAllClusterResponse(com.webank.wedatasphere.qualitis.response.GetAllClusterResponse) DataSourceModifyRequest(com.webank.wedatasphere.qualitis.request.DataSourceModifyRequest) AddMultiSourceRuleRequest(com.webank.wedatasphere.qualitis.rule.request.multi.AddMultiSourceRuleRequest) MappingOperationEnum(com.webank.wedatasphere.qualitis.rule.constant.MappingOperationEnum) Context(javax.ws.rs.core.Context) TableInfoDetail(com.webank.wedatasphere.qualitis.metadata.response.table.TableInfoDetail) Set(java.util.Set) Collectors(java.util.stream.Collectors) MetaDataAcquireFailedException(com.webank.wedatasphere.qualitis.metadata.exception.MetaDataAcquireFailedException) GetDbByUserAndClusterRequest(com.webank.wedatasphere.qualitis.metadata.request.GetDbByUserAndClusterRequest) List(java.util.List) ClusterInfo(com.webank.wedatasphere.qualitis.entity.ClusterInfo) MetaDataClient(com.webank.wedatasphere.qualitis.metadata.client.MetaDataClient) Pattern(java.util.regex.Pattern) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) DataSourceConnectRequest(com.webank.wedatasphere.qualitis.request.DataSourceConnectRequest) GetUserClusterRequest(com.webank.wedatasphere.qualitis.request.GetUserClusterRequest) UnsupportedEncodingException(java.io.UnsupportedEncodingException) BlackListFilterTypeEnum(com.webank.wedatasphere.qualitis.constant.BlackListFilterTypeEnum) ClusterInfoDetail(com.webank.wedatasphere.qualitis.metadata.response.cluster.ClusterInfoDetail) GetTableByUserAndDbRequest(com.webank.wedatasphere.qualitis.metadata.request.GetTableByUserAndDbRequest) Project(com.webank.wedatasphere.qualitis.project.entity.Project) RuleLimitationService(com.webank.wedatasphere.qualitis.rule.service.RuleLimitationService) SpecCharEnum(com.webank.wedatasphere.qualitis.constant.SpecCharEnum) MulDbRequest(com.webank.wedatasphere.qualitis.request.MulDbRequest) RuleDataSourceDao(com.webank.wedatasphere.qualitis.rule.dao.RuleDataSourceDao) ProjectDao(com.webank.wedatasphere.qualitis.project.dao.ProjectDao) DataSourceParamModifyRequest(com.webank.wedatasphere.qualitis.request.DataSourceParamModifyRequest) FilterRequest(com.webank.wedatasphere.qualitis.request.FilterRequest) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) HttpServletRequest(javax.servlet.http.HttpServletRequest) CheckTemplateEnum(com.webank.wedatasphere.qualitis.rule.constant.CheckTemplateEnum) CollectionUtils(org.apache.commons.collections.CollectionUtils) Service(org.springframework.stereotype.Service) GetUserTableByCsIdRequest(com.webank.wedatasphere.qualitis.metadata.request.GetUserTableByCsIdRequest) CompareTypeEnum(com.webank.wedatasphere.qualitis.rule.constant.CompareTypeEnum) MetaDataService(com.webank.wedatasphere.qualitis.service.MetaDataService) MultiDataSourceJoinColumnRequest(com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceJoinColumnRequest) CsTableInfoDetail(com.webank.wedatasphere.qualitis.metadata.response.table.CsTableInfoDetail) Logger(org.slf4j.Logger) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) GetColumnByUserAndTableRequest(com.webank.wedatasphere.qualitis.metadata.request.GetColumnByUserAndTableRequest) GetUserColumnByTableIdRequest(com.webank.wedatasphere.qualitis.request.GetUserColumnByTableIdRequest) ColumnInfoDetail(com.webank.wedatasphere.qualitis.metadata.response.column.ColumnInfoDetail) DbInfoDetail(com.webank.wedatasphere.qualitis.metadata.response.db.DbInfoDetail) DataInfo(com.webank.wedatasphere.qualitis.metadata.response.DataInfo) MultiSourceRuleService(com.webank.wedatasphere.qualitis.rule.service.MultiSourceRuleService) RuleDao(com.webank.wedatasphere.qualitis.rule.dao.RuleDao) MultiDataSourceJoinConfigRequest(com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceJoinConfigRequest) GetUserTableByDbIdRequest(com.webank.wedatasphere.qualitis.request.GetUserTableByDbIdRequest) Comparator(java.util.Comparator) Collections(java.util.Collections) Transactional(org.springframework.transaction.annotation.Transactional) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) ArrayList(java.util.ArrayList) MetaDataAcquireFailedException(com.webank.wedatasphere.qualitis.metadata.exception.MetaDataAcquireFailedException) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) FilterRequest(com.webank.wedatasphere.qualitis.request.FilterRequest) List(java.util.List) ArrayList(java.util.ArrayList) GetAllResponse(com.webank.wedatasphere.qualitis.response.GetAllResponse) TableInfoDetail(com.webank.wedatasphere.qualitis.metadata.response.table.TableInfoDetail) CsTableInfoDetail(com.webank.wedatasphere.qualitis.metadata.response.table.CsTableInfoDetail) Map(java.util.Map) HashSet(java.util.HashSet) AddMultiSourceRuleRequest(com.webank.wedatasphere.qualitis.rule.request.multi.AddMultiSourceRuleRequest) Transactional(org.springframework.transaction.annotation.Transactional)

Example 5 with AddMultiSourceRuleRequest

use of com.webank.wedatasphere.qualitis.rule.request.multi.AddMultiSourceRuleRequest in project Qualitis by WeBankFinTech.

the class MetaDataServiceImpl method withWhiteListAndFilterRequest.

private void withWhiteListAndFilterRequest(int i, int ruleIndex, int sourceTableSize, int total, List<String> whiteList, List<FilterRequest> filterRequests, MulDbRequest request, String loginUser, boolean check) {
    for (; i < total - filterRequests.size(); i++) {
        String currentTables = whiteList.get(i - ruleIndex - sourceTableSize);
        String currentSourceTable = currentTables.split(SpecCharEnum.COLON.getValue())[0];
        String currentTargetTable = currentTables.split(SpecCharEnum.COLON.getValue())[1];
        try {
            // Construct add multi source rule request.
            AddMultiSourceRuleRequest addMultiSourceRuleRequest = constructRequest(request, null, currentSourceTable, currentTargetTable, i, total, loginUser);
            LOGGER.info("Start to add {}th multi source rule.", i);
            if (ruleIndex > 0) {
                check = false;
            }
            multiSourceRuleService.addMultiSourceRule(addMultiSourceRuleRequest, check);
        } catch (Exception e) {
            LOGGER.error("One of rule failed to add, rule index:[{}], table name: [{}], exception:{}", i, currentSourceTable + " VS " + currentTargetTable, e.getMessage());
        }
        LOGGER.info("Finish to add {}th multi source rule.", i);
    }
    for (; i < total; i++) {
        FilterRequest filterRequest = filterRequests.get(i - ruleIndex - sourceTableSize - whiteList.size());
        try {
            AddMultiSourceRuleRequest addMultiSourceRuleRequest = constructRequest(request, filterRequest, "", "", i, total, loginUser);
            LOGGER.info("Start to add {}th multi source rule.", i);
            if (i > 0) {
                check = false;
            }
            multiSourceRuleService.addMultiSourceRule(addMultiSourceRuleRequest, check);
        } catch (Exception e) {
            LOGGER.error("One of rule failed to add, rule index:[{}], table name: [{}], exception:{}", i, filterRequest.getSourceTable() + SpecCharEnum.COMMA.getValue() + filterRequest.getTargetTable(), e.getMessage());
        }
        LOGGER.info("Finish to add {}th multi source rule.", i);
    }
}
Also used : FilterRequest(com.webank.wedatasphere.qualitis.request.FilterRequest) MetaDataAcquireFailedException(com.webank.wedatasphere.qualitis.metadata.exception.MetaDataAcquireFailedException) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) AddMultiSourceRuleRequest(com.webank.wedatasphere.qualitis.rule.request.multi.AddMultiSourceRuleRequest)

Aggregations

AddMultiSourceRuleRequest (com.webank.wedatasphere.qualitis.rule.request.multi.AddMultiSourceRuleRequest)7 UnExpectedRequestException (com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException)6 ArrayList (java.util.ArrayList)5 AlarmConfigRequest (com.webank.wedatasphere.qualitis.rule.request.AlarmConfigRequest)4 MultiDataSourceConfigRequest (com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceConfigRequest)4 MultiDataSourceJoinConfigRequest (com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceJoinConfigRequest)4 MetaDataAcquireFailedException (com.webank.wedatasphere.qualitis.metadata.exception.MetaDataAcquireFailedException)3 GeneralResponse (com.webank.wedatasphere.qualitis.response.GeneralResponse)3 Rule (com.webank.wedatasphere.qualitis.rule.entity.Rule)3 RuleGroup (com.webank.wedatasphere.qualitis.rule.entity.RuleGroup)3 MultiDataSourceJoinColumnRequest (com.webank.wedatasphere.qualitis.rule.request.multi.MultiDataSourceJoinColumnRequest)3 IOException (java.io.IOException)3 List (java.util.List)3 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 SpecCharEnum (com.webank.wedatasphere.qualitis.constant.SpecCharEnum)2 ColumnInfoDetail (com.webank.wedatasphere.qualitis.metadata.response.column.ColumnInfoDetail)2 ProjectDao (com.webank.wedatasphere.qualitis.project.dao.ProjectDao)2 Project (com.webank.wedatasphere.qualitis.project.entity.Project)2 ProjectService (com.webank.wedatasphere.qualitis.project.service.ProjectService)2