Search in sources :

Example 21 with ClusterInfo

use of com.webank.wedatasphere.qualitis.entity.ClusterInfo in project Qualitis by WeBankFinTech.

the class ApplicationServiceImpl method uploadDataSourceAnalysisResult.

@Override
public GeneralResponse<?> uploadDataSourceAnalysisResult(UploadResultRequest request) throws UnExpectedRequestException, IOException {
    // Login user permission.
    Long userId = HttpUtils.getUserId(httpServletRequest);
    User user = userDao.findById(userId);
    if (user == null) {
        throw new UnExpectedRequestException("User {&DOES_NOT_EXIST}");
    }
    UploadResultRequest.checkRequest(request);
    List<ApplicationClusterResponse> responses = (List<ApplicationClusterResponse>) getDataSource(new PageRequest(0, Integer.MAX_VALUE)).getData();
    List<String> tables = responses.stream().filter(cluster -> cluster.getClusterName().equals(request.getClusterName())).map(ApplicationClusterResponse::getDatabase).flatMap(database -> database.stream()).filter(databaseResponse -> databaseResponse.getDatabaseName().equals(request.getDatabaseName())).map(ApplicationDatabaseResponse::getTable).flatMap(table -> table.stream()).distinct().collect(Collectors.toList());
    if (StringUtils.isNotBlank(request.getTableName())) {
        tables.clear();
        tables.add(request.getTableName());
    }
    LOGGER.info("Start to write excel");
    StringBuffer fileName = new StringBuffer();
    fileName.append(linkisConfig.getUploadTmpPath()).append(File.separator).append(user.getUserName()).append("_").append(request.getClusterName()).append("_").append(request.getDatabaseName()).append("_").append(UUID.randomUUID().toString()).append(ExcelTypeEnum.XLSX.getValue());
    File tmpFile = new File(fileName.toString());
    writeExcelFile(tmpFile, tables, request);
    // Upload to HDFS
    ClusterInfo clusterInfo = clusterInfoDao.findByClusterName(request.getClusterName());
    if (clusterInfo == null) {
        throw new UnExpectedRequestException("Cluster info " + "[" + request.getClusterName() + "]" + "{&DOES_NOT_EXIST}");
    }
    // send request to get dbs
    String url = UriBuilder.fromUri(clusterInfo.getLinkisAddress()).path(linkisConfig.getPrefix()).path(linkisConfig.getUpload()).toString();
    CloseableHttpClient httpclient = HttpClients.createDefault();
    HttpPost httppost = new HttpPost(url);
    MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
    multipartEntityBuilder.setContentType(ContentType.MULTIPART_FORM_DATA);
    multipartEntityBuilder.setCharset(Charset.forName("UTF-8"));
    if (clusterInfo.getClusterType().endsWith(LINKIS_ONE_VERSION)) {
        multipartEntityBuilder.addTextBody("path", linkisConfig.getUploadPrefix() + LINKIS_ONE_UPLOAD_PREFIX + request.getHdfsPath());
    } else {
        multipartEntityBuilder.addTextBody("path", linkisConfig.getUploadPrefix() + request.getHdfsPath());
    }
    multipartEntityBuilder.addBinaryBody("file", tmpFile);
    httppost.addHeader("Token-User", user.getUserName());
    httppost.addHeader("Token-Code", clusterInfo.getLinkisToken());
    httppost.setEntity(multipartEntityBuilder.build());
    CloseableHttpResponse response = null;
    try {
        response = httpclient.execute(httppost);
    } catch (IOException e) {
        throw new UnExpectedRequestException("{&FAILED_TO_CALL_UPLOAD_API}");
    }
    int code = response.getStatusLine().getStatusCode();
    response.close();
    if (code != HttpStatus.SC_OK) {
        throw new UnExpectedRequestException("{&FAILED_TO_CALL_UPLOAD_API}");
    }
    boolean tmpDeleteFlag = tmpFile.delete();
    LOGGER.info("Delete tmp excel: " + tmpDeleteFlag);
    return new GeneralResponse<>(code + "", "{&SUCCESS_TO_UPLOAD_ANALYSIS_EXCEL}", code);
}
Also used : HttpPost(org.apache.http.client.methods.HttpPost) AlarmConfigStatusEnum(com.webank.wedatasphere.qualitis.constant.AlarmConfigStatusEnum) StringUtils(org.apache.commons.lang.StringUtils) LinkisConfig(com.webank.wedatasphere.qualitis.config.LinkisConfig) LoggerFactory(org.slf4j.LoggerFactory) HttpStatus(org.apache.http.HttpStatus) Autowired(org.springframework.beans.factory.annotation.Autowired) Application(com.webank.wedatasphere.qualitis.entity.Application) ProjectUserDao(com.webank.wedatasphere.qualitis.project.dao.ProjectUserDao) ApplicationDatabaseResponse(com.webank.wedatasphere.qualitis.response.ApplicationDatabaseResponse) GeneralResponse(com.webank.wedatasphere.qualitis.response.GeneralResponse) ClusterInfoDao(com.webank.wedatasphere.qualitis.dao.ClusterInfoDao) FilterDataSourceRequest(com.webank.wedatasphere.qualitis.request.FilterDataSourceRequest) HttpUtils(com.webank.wedatasphere.qualitis.util.HttpUtils) Task(com.webank.wedatasphere.qualitis.entity.Task) TaskRuleAlarmConfig(com.webank.wedatasphere.qualitis.entity.TaskRuleAlarmConfig) Map(java.util.Map) ApplicationClusterResponse(com.webank.wedatasphere.qualitis.response.ApplicationClusterResponse) UriBuilder(javax.ws.rs.core.UriBuilder) GetAllResponse(com.webank.wedatasphere.qualitis.response.GetAllResponse) Path(java.nio.file.Path) RestTemplate(org.springframework.web.client.RestTemplate) Context(javax.ws.rs.core.Context) MultipartEntityBuilder(org.apache.http.entity.mime.MultipartEntityBuilder) PageRequest(com.webank.wedatasphere.qualitis.request.PageRequest) UploadResultRequest(com.webank.wedatasphere.qualitis.request.UploadResultRequest) FilterAdvanceRequest(com.webank.wedatasphere.qualitis.request.FilterAdvanceRequest) ContentType(org.apache.http.entity.ContentType) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) FileNotFoundException(java.io.FileNotFoundException) TaskRuleSimpleDao(com.webank.wedatasphere.qualitis.dao.TaskRuleSimpleDao) ExcelTypeEnum(com.alibaba.excel.support.ExcelTypeEnum) List(java.util.List) Sheet(com.alibaba.excel.metadata.Sheet) ClusterInfo(com.webank.wedatasphere.qualitis.entity.ClusterInfo) MetaDataClient(com.webank.wedatasphere.qualitis.metadata.client.MetaDataClient) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) HttpClients(org.apache.http.impl.client.HttpClients) BeanUtils(org.springframework.beans.BeanUtils) TaskStatusEnum(com.webank.wedatasphere.qualitis.constant.TaskStatusEnum) ApplicationResponse(com.webank.wedatasphere.qualitis.response.ApplicationResponse) HashMap(java.util.HashMap) FilterProjectRequest(com.webank.wedatasphere.qualitis.request.FilterProjectRequest) FilterStatusRequest(com.webank.wedatasphere.qualitis.request.FilterStatusRequest) ProjectDao(com.webank.wedatasphere.qualitis.project.dao.ProjectDao) ArrayList(java.util.ArrayList) ExcelWriter(com.alibaba.excel.ExcelWriter) HttpServletRequest(javax.servlet.http.HttpServletRequest) User(com.webank.wedatasphere.qualitis.entity.User) CheckTemplateEnum(com.webank.wedatasphere.qualitis.rule.constant.CheckTemplateEnum) Charset(java.nio.charset.Charset) TaskDao(com.webank.wedatasphere.qualitis.dao.TaskDao) CloseableHttpResponse(org.apache.http.client.methods.CloseableHttpResponse) Service(org.springframework.stereotype.Service) ApplicationStatusEnum(com.webank.wedatasphere.qualitis.constant.ApplicationStatusEnum) CompareTypeEnum(com.webank.wedatasphere.qualitis.rule.constant.CompareTypeEnum) ApplicationService(com.webank.wedatasphere.qualitis.service.ApplicationService) TaskResult(com.webank.wedatasphere.qualitis.entity.TaskResult) OutputStream(java.io.OutputStream) CloseableHttpClient(org.apache.http.impl.client.CloseableHttpClient) Logger(org.slf4j.Logger) Files(java.nio.file.Files) RuleMetric(com.webank.wedatasphere.qualitis.entity.RuleMetric) TaskDataSourceDao(com.webank.wedatasphere.qualitis.dao.TaskDataSourceDao) ExcelResult(com.webank.wedatasphere.qualitis.excel.ExcelResult) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) File(java.io.File) TaskRuleSimple(com.webank.wedatasphere.qualitis.entity.TaskRuleSimple) ExcelSheetName(com.webank.wedatasphere.qualitis.project.constant.ExcelSheetName) Paths(java.nio.file.Paths) ApplicationDao(com.webank.wedatasphere.qualitis.dao.ApplicationDao) UserDao(com.webank.wedatasphere.qualitis.dao.UserDao) TaskResultDao(com.webank.wedatasphere.qualitis.dao.TaskResultDao) TaskDataSource(com.webank.wedatasphere.qualitis.entity.TaskDataSource) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) CloseableHttpClient(org.apache.http.impl.client.CloseableHttpClient) HttpPost(org.apache.http.client.methods.HttpPost) User(com.webank.wedatasphere.qualitis.entity.User) MultipartEntityBuilder(org.apache.http.entity.mime.MultipartEntityBuilder) ApplicationClusterResponse(com.webank.wedatasphere.qualitis.response.ApplicationClusterResponse) IOException(java.io.IOException) GeneralResponse(com.webank.wedatasphere.qualitis.response.GeneralResponse) PageRequest(com.webank.wedatasphere.qualitis.request.PageRequest) ClusterInfo(com.webank.wedatasphere.qualitis.entity.ClusterInfo) CloseableHttpResponse(org.apache.http.client.methods.CloseableHttpResponse) List(java.util.List) ArrayList(java.util.ArrayList) File(java.io.File)

Example 22 with ClusterInfo

use of com.webank.wedatasphere.qualitis.entity.ClusterInfo in project Qualitis by WeBankFinTech.

the class JobServiceImpl method getTaskLog.

@Override
public GeneralResponse<?> getTaskLog(Long taskId, String clusterName) throws UnExpectedRequestException {
    Task task = taskDao.findById(taskId);
    if (task == null) {
        throw new UnExpectedRequestException("{&JOB_ID_DOES_NOT_EXIST}");
    }
    ClusterInfo clusterInfo = clusterInfoDao.findByClusterName(clusterName);
    if (clusterInfo == null) {
        throw new UnExpectedRequestException("Cluster info {&DOES_NOT_EXIST}");
    }
    LogResult logResult;
    String proxyUser = task.getTaskProxyUser();
    try {
        logResult = monitorManager.getTaskPartialLog(task.getTaskRemoteId(), 0, StringUtils.isNotBlank(proxyUser) ? proxyUser : task.getApplication().getExecuteUser(), clusterInfo.getLinkisAddress(), clusterName);
    } catch (LogPartialException | ClusterInfoNotConfigException e) {
        throw new UnExpectedRequestException(e.getMessage());
    }
    LOGGER.info("Succeed to get task log, task_id: {}, cluster_id: {}", taskId, clusterName);
    return new GeneralResponse<>("200", "{&SUCCEED_TO_GET_TASK_LOG}", logResult.getLog());
}
Also used : GeneralResponse(com.webank.wedatasphere.qualitis.response.GeneralResponse) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) Task(com.webank.wedatasphere.qualitis.entity.Task) ClusterInfo(com.webank.wedatasphere.qualitis.entity.ClusterInfo) LogResult(com.webank.wedatasphere.qualitis.bean.LogResult) LogPartialException(com.webank.wedatasphere.qualitis.exception.LogPartialException) ClusterInfoNotConfigException(com.webank.wedatasphere.qualitis.exception.ClusterInfoNotConfigException)

Example 23 with ClusterInfo

use of com.webank.wedatasphere.qualitis.entity.ClusterInfo in project Qualitis by WeBankFinTech.

the class ClusterInfoServiceImpl method deleteClusterInfo.

@Override
@Transactional(rollbackFor = { RuntimeException.class, UnExpectedRequestException.class })
public GeneralResponse<?> deleteClusterInfo(DeleteClusterInfoRequest request) throws UnExpectedRequestException {
    // 检查参数
    checkRequest(request);
    // 根据id查找ClusterInfo,不存在则抛出异常
    Long clusterInfoId = request.getClusterInfoId();
    ClusterInfo clusterInfoInDb = clusterInfoDao.findById(clusterInfoId);
    if (clusterInfoInDb == null) {
        throw new UnExpectedRequestException("id {&DOES_NOT_EXIST}");
    }
    // 删除clusterInfo
    clusterInfoDao.deleteClusterInfo(clusterInfoInDb);
    LOGGER.info("Succeed to delete cluster_info. id: {}", request.getClusterInfoId());
    return new GeneralResponse<>("200", "{&DELETE_CLUSTER_INFO_SUCCESSFULLY}", null);
}
Also used : GeneralResponse(com.webank.wedatasphere.qualitis.response.GeneralResponse) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) ClusterInfo(com.webank.wedatasphere.qualitis.entity.ClusterInfo) Transactional(org.springframework.transaction.annotation.Transactional)

Example 24 with ClusterInfo

use of com.webank.wedatasphere.qualitis.entity.ClusterInfo in project Qualitis by WeBankFinTech.

the class ClusterInfoServiceImpl method modifyClusterInfo.

@Override
@Transactional(rollbackFor = { RuntimeException.class, UnExpectedRequestException.class })
public GeneralResponse<?> modifyClusterInfo(ModifyClusterInfoRequest request) throws UnExpectedRequestException {
    // 检查参数
    checkRequest(request);
    // 根据id查找clusterInfo,不存在抛出异常
    Long id = request.getClusterInfoId();
    ClusterInfo clusterInfoInDb = clusterInfoDao.findById(id);
    if (clusterInfoInDb == null) {
        throw new UnExpectedRequestException("id {&DOES_NOT_EXIST}");
    }
    LOGGER.info("Succeed to find cluster_info. cluster_info: {}", clusterInfoInDb);
    // 修改clusterInfo信息
    String clusterName = request.getClusterName();
    String clusterType = request.getClusterType();
    clusterInfoInDb.setClusterName(clusterName);
    clusterInfoInDb.setClusterType(clusterType);
    clusterInfoInDb.setLinkisAddress(request.getLinkisAddress());
    clusterInfoInDb.setLinkisToken(request.getLinkisToken());
    // 保存clusterInfo
    ClusterInfo savedClusterInfo = clusterInfoDao.saveClusterInfo(clusterInfoInDb);
    LOGGER.info("Succeed to modify cluster_info. cluster_info: {}", savedClusterInfo);
    return new GeneralResponse<>("200", "{&MODIFY_CLUSTER_INFO_SUCCESSFULLY}", null);
}
Also used : GeneralResponse(com.webank.wedatasphere.qualitis.response.GeneralResponse) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) ClusterInfo(com.webank.wedatasphere.qualitis.entity.ClusterInfo) Transactional(org.springframework.transaction.annotation.Transactional)

Example 25 with ClusterInfo

use of com.webank.wedatasphere.qualitis.entity.ClusterInfo in project Qualitis by WeBankFinTech.

the class OuterExecutionServiceImpl method checkDatasource.

private void checkDatasource(Rule currentRule, String userName, StringBuffer partition, List<Map<String, String>> mappingCols, String nodeName, String clusterName, Map<Long, Map> dataSourceMysqlConnect) throws UnExpectedRequestException, MetaDataAcquireFailedException, DataSourceOverSizeException, DataSourceMoveException, BothNullDatasourceException, LeftNullDatasourceException, RightNullDatasourceException {
    // For multi source rule to check tables' size before submit.
    List<Double> datasourceSizeList = new ArrayList<>(currentRule.getRuleDataSources().size());
    for (RuleDataSource ruleDataSource : currentRule.getRuleDataSources()) {
        Map<String, String> mappingCol = null;
        if (ORIGINAL_INDEX.equals(ruleDataSource.getDatasourceIndex())) {
            continue;
        }
        if (ruleDataSource.getDatasourceIndex() != null && mappingCols.get(ruleDataSource.getDatasourceIndex()).size() > 0) {
            mappingCol = mappingCols.get(ruleDataSource.getDatasourceIndex());
        }
        if (ruleDataSource.getLinkisDataSourceId() != null) {
            LOGGER.info("Start to solve relationship datasource info.");
            checkRdmsSqlMetaInfo(StringUtils.isNotBlank(clusterName) ? clusterName : ruleDataSource.getClusterName(), userName, ruleDataSource, mappingCol);
            GeneralResponse<Map> dataSourceInfoDetail = metaDataClient.getDataSourceInfoDetail(StringUtils.isNotBlank(clusterName) ? clusterName : ruleDataSource.getClusterName(), userName, ruleDataSource.getLinkisDataSourceId(), ruleDataSource.getLinkisDataSourceVersionId());
            GeneralResponse<Map> dataSourceConnectParams = metaDataClient.getDataSourceConnectParams(StringUtils.isNotBlank(clusterName) ? clusterName : ruleDataSource.getClusterName(), userName, ruleDataSource.getLinkisDataSourceId(), ruleDataSource.getLinkisDataSourceVersionId());
            Map connectParamsReal = (Map) dataSourceConnectParams.getData().get("connectParams");
            if (connectParamsReal.size() == 0) {
                throw new UnExpectedRequestException("{&THE_DATASOURCE_IS_NOT_DEPLOYED}");
            }
            Map connectParams = (Map) ((Map) dataSourceInfoDetail.getData().get("info")).get("connectParams");
            String dataType = (String) ((Map) ((Map) dataSourceInfoDetail.getData().get("info")).get("dataSourceType")).get("name");
            connectParams.put("dataType", dataType);
            dataSourceMysqlConnect.put(ruleDataSource.getId(), connectParams);
            continue;
        }
        // Parse filter fields.
        List<String> filterFields = getFilterFields(partition.toString());
        if (StringUtils.isNotBlank(ruleDataSource.getDbName()) && !ruleDataSource.getDbName().equals(RuleConstraintEnum.CUSTOM_DATABASE_PREFIS.getValue())) {
            // Get actual fields info.
            List<ColumnInfoDetail> cols = metaDataClient.getColumnInfo(StringUtils.isNotBlank(clusterName) ? clusterName : ruleDataSource.getClusterName(), ruleDataSource.getDbName(), ruleDataSource.getTableName(), userName);
            if (CollectionUtils.isEmpty(cols)) {
                throw new DataSourceMoveException("Table[" + ruleDataSource.getTableName() + "]. {&RULE_DATASOURCE_BE_MOVED}");
            }
            // Get actual partition fields.
            List<String> partitionFields = cols.stream().filter(ColumnInfoDetail::getPartitionField).map(ColumnInfoDetail::getFieldName).collect(Collectors.toList());
            // Check filter fields.
            boolean partitionTable = CollectionUtils.isNotEmpty(partitionFields);
            if (partitionTable && partition.length() > 0) {
                for (String filter : filterFields) {
                    if (!partitionFields.contains(filter)) {
                        throw new UnExpectedRequestException("Table[" + ruleDataSource.getTableName() + "]. {&THE_CHECK_FIELD_DOES_NOT_EXIST_IN_PARTITIONS}[" + filter + "]");
                    }
                }
                // Check partition size.
                PartitionStatisticsInfo partitionStatisticsInfo = metaDataClient.getPartitionStatisticsInfo(StringUtils.isNotBlank(clusterName) ? clusterName : ruleDataSource.getClusterName(), ruleDataSource.getDbName(), ruleDataSource.getTableName(), filterToPartitionPath(partition.toString()), userName);
                String fullSize = partitionStatisticsInfo.getPartitionSize();
                ClusterInfo clusterInfo = clusterInfoDao.findByClusterName(StringUtils.isNotBlank(clusterName) ? clusterName : ruleDataSource.getClusterName());
                if (clusterInfo != null && StringUtils.isNotBlank(clusterInfo.getSkipDataSize()) && StringUtils.isNotBlank(fullSize)) {
                    double number = 0;
                    String unit = "B";
                    if (!"0B".equals(fullSize)) {
                        number = Double.parseDouble(fullSize.split(" ")[0]);
                        unit = fullSize.split(" ")[1];
                    }
                    datasourceSizeList.add(number);
                    String[] skipDataSize = clusterInfo.getSkipDataSize().split(" ");
                    double res = UnitTransfer.alarmconfigToTaskResult(number, skipDataSize[1], unit);
                    LOGGER.info("Check datasource[" + fullSize + "] if or not oversize with system config[" + clusterInfo.getSkipDataSize() + "]");
                    if (res > Double.parseDouble(skipDataSize[0])) {
                        throw new DataSourceOverSizeException("Table[" + ruleDataSource.getTableName() + "]. {&TABLE_IS_OVERSIZE_WITH_SYSTEM_CONFIG}:[" + clusterInfo.getSkipDataSize() + "]");
                    }
                }
            } else {
                // Check table size.
                TableStatisticsInfo tableStatisticsInfo = metaDataClient.getTableStatisticsInfo(StringUtils.isNotBlank(clusterName) ? clusterName : ruleDataSource.getClusterName(), ruleDataSource.getDbName(), ruleDataSource.getTableName(), userName);
                String fullSize = tableStatisticsInfo.getTableSize();
                if (NULL_TABLE_SIZE.equals(fullSize)) {
                    throw new DataSourceMoveException("Table[" + ruleDataSource.getTableName() + "] {&RULE_DATASOURCE_BE_MOVED}");
                }
                ClusterInfo clusterInfo = clusterInfoDao.findByClusterName(StringUtils.isNotBlank(clusterName) ? clusterName : ruleDataSource.getClusterName());
                if (clusterInfo != null && StringUtils.isNotBlank(clusterInfo.getSkipDataSize()) && StringUtils.isNotBlank(fullSize)) {
                    LOGGER.info("Check datasource[" + fullSize + "] if or not oversize with system config[" + clusterInfo.getSkipDataSize() + "]");
                    double number = 0;
                    String unit = "B";
                    if (!"0B".equals(fullSize)) {
                        number = Double.parseDouble(fullSize.split(" ")[0]);
                        unit = fullSize.split(" ")[1];
                    }
                    datasourceSizeList.add(number);
                    String[] skipDataSize = clusterInfo.getSkipDataSize().split(" ");
                    double res = UnitTransfer.alarmconfigToTaskResult(number, skipDataSize[1], unit);
                    if (res > Double.parseDouble(skipDataSize[0])) {
                        throw new DataSourceOverSizeException("Table[" + ruleDataSource.getTableName() + "] is oversize with system config:[" + clusterInfo.getSkipDataSize() + "]");
                    }
                }
                partition.delete(0, partition.length());
            }
            if (currentRule.getRuleType().equals(RuleTypeEnum.CUSTOM_RULE.getCode())) {
                continue;
            }
            if (!metaDataClient.fieldExist(ruleDataSource.getColName(), cols, mappingCol)) {
                throw new DataSourceMoveException("Table[" + ruleDataSource.getTableName() + "] {&RULE_DATASOURCE_BE_MOVED}");
            }
        } else if (StringUtils.isNotBlank(currentRule.getCsId())) {
            checkDatasourceInContextService(ruleDataSource, mappingCol, clusterName, userName, nodeName, currentRule.getCsId());
        }
    }
    if (CollectionUtils.isNotEmpty(datasourceSizeList) && currentRule.getRuleType().equals(RuleTypeEnum.MULTI_TEMPLATE_RULE.getCode())) {
        double left = datasourceSizeList.get(0);
        double right = datasourceSizeList.get(1);
        LOGGER.info("Current multi source rule left table size number[{}], right table size number[{}]", left, right);
        if (left == 0 && right == 0) {
            throw new BothNullDatasourceException("{&BOTH_SIDE_ARE_NULL}");
        } else if (left == 0) {
            throw new LeftNullDatasourceException("{&ONE_SIDE_ARE_NULL}");
        } else if (right == 0) {
            throw new RightNullDatasourceException("{&ONE_SIDE_ARE_NULL}");
        }
    }
}
Also used : UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) RuleDataSource(com.webank.wedatasphere.qualitis.rule.entity.RuleDataSource) ArrayList(java.util.ArrayList) LeftNullDatasourceException(com.webank.wedatasphere.qualitis.exception.LeftNullDatasourceException) RightNullDatasourceException(com.webank.wedatasphere.qualitis.exception.RightNullDatasourceException) ColumnInfoDetail(com.webank.wedatasphere.qualitis.metadata.response.column.ColumnInfoDetail) DataSourceOverSizeException(com.webank.wedatasphere.qualitis.exception.DataSourceOverSizeException) ClusterInfo(com.webank.wedatasphere.qualitis.entity.ClusterInfo) DataSourceMoveException(com.webank.wedatasphere.qualitis.exception.DataSourceMoveException) BothNullDatasourceException(com.webank.wedatasphere.qualitis.exception.BothNullDatasourceException) PartitionStatisticsInfo(com.webank.wedatasphere.qualitis.metadata.response.table.PartitionStatisticsInfo) TableStatisticsInfo(com.webank.wedatasphere.qualitis.metadata.response.table.TableStatisticsInfo) Map(java.util.Map) LinkedHashMap(java.util.LinkedHashMap) HashMap(java.util.HashMap)

Aggregations

ClusterInfo (com.webank.wedatasphere.qualitis.entity.ClusterInfo)41 Map (java.util.Map)31 HttpEntity (org.springframework.http.HttpEntity)28 HttpHeaders (org.springframework.http.HttpHeaders)28 MetaDataAcquireFailedException (com.webank.wedatasphere.qualitis.metadata.exception.MetaDataAcquireFailedException)27 JSONObject (org.json.JSONObject)26 GeneralResponse (com.webank.wedatasphere.qualitis.response.GeneralResponse)25 ArrayList (java.util.ArrayList)18 UnExpectedRequestException (com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException)17 List (java.util.List)14 ColumnInfoDetail (com.webank.wedatasphere.qualitis.metadata.response.column.ColumnInfoDetail)7 UriBuilder (javax.ws.rs.core.UriBuilder)7 DataInfo (com.webank.wedatasphere.qualitis.metadata.response.DataInfo)6 Task (com.webank.wedatasphere.qualitis.entity.Task)5 PartitionStatisticsInfo (com.webank.wedatasphere.qualitis.metadata.response.table.PartitionStatisticsInfo)5 LinkisConfig (com.webank.wedatasphere.qualitis.config.LinkisConfig)4 ClusterInfoDao (com.webank.wedatasphere.qualitis.dao.ClusterInfoDao)4 TableStatisticsInfo (com.webank.wedatasphere.qualitis.metadata.response.table.TableStatisticsInfo)4 JSONException (org.json.JSONException)4 RestClientException (org.springframework.web.client.RestClientException)4