use of com.alibaba.otter.node.etl.common.pipe.impl.http.archive.ArchiveException in project otter by alibaba.
the class RemoteUrlBuilder method getUrl.
public String getUrl(Long pipelineId, String filePath) {
Node node = configClientService.currentNode();
Pipeline pipeline = configClientService.findPipeline(pipelineId);
String ip = node.getIp();
if (node.getParameters().getUseExternalIp() || pipeline.getParameters().getUseExternalIp()) {
ip = node.getParameters().getExternalIp();
if (StringUtils.isEmpty(ip)) {
throw new ArchiveException(String.format("pipelineId:%s useExternalIp by nid[%s] has no external ip", String.valueOf(pipelineId), String.valueOf(node.getId())));
}
}
// 注意为其下载端口
Integer port = node.getParameters().getDownloadPort();
if (port == null || port < 0) {
port = defaultDownloadPort;
}
return MessageFormat.format(urlFormat, ip, String.valueOf(port), filePath);
}
Aggregations