Search in sources :

Example 1 with IDataDownloadService

use of com.dtstack.taier.develop.service.develop.IDataDownloadService in project Taier by DTStack.

the class BatchDownloadService method buildIDownLoad.

private IDownload buildIDownLoad(String jobId, Integer taskType, Long tenantId, Integer limitNum) {
    if (StringUtils.isBlank(jobId)) {
        throw new RdosDefineException("engineJobId 不能为空");
    }
    IDataDownloadService dataDownloadService = multiEngineServiceFactory.getDataDownloadService(taskType);
    Preconditions.checkNotNull(dataDownloadService, String.format("not support engineType %d", taskType));
    return dataDownloadService.buildIDownLoad(jobId, taskType, tenantId, limitNum);
}
Also used : IDataDownloadService(com.dtstack.taier.develop.service.develop.IDataDownloadService) RdosDefineException(com.dtstack.taier.common.exception.RdosDefineException)

Example 2 with IDataDownloadService

use of com.dtstack.taier.develop.service.develop.IDataDownloadService in project Taier by DTStack.

the class BatchDownloadService method downloadAppTypeLog.

public String downloadAppTypeLog(Long tenantId, String jobId, Integer limitNum, String logType, Integer taskType) {
    IDataDownloadService dataDownloadService = multiEngineServiceFactory.getDataDownloadService(taskType);
    IDownload downloader = dataDownloadService.typeLogDownloader(tenantId, jobId, limitNum == null ? Integer.MAX_VALUE : limitNum, logType);
    if (Objects.isNull(downloader)) {
        LOGGER.error("-----日志文件导出失败-----");
        return "-----日志文件不存在-----";
    }
    StringBuilder result = new StringBuilder();
    while (!downloader.reachedEnd()) {
        Object row = downloader.readNext();
        result.append(row);
    }
    return result.toString();
}
Also used : IDataDownloadService(com.dtstack.taier.develop.service.develop.IDataDownloadService) IDownload(com.dtstack.taier.develop.utils.develop.common.IDownload)

Aggregations

IDataDownloadService (com.dtstack.taier.develop.service.develop.IDataDownloadService)2 RdosDefineException (com.dtstack.taier.common.exception.RdosDefineException)1 IDownload (com.dtstack.taier.develop.utils.develop.common.IDownload)1