This is an automated email from the ASF dual-hosted git repository. journey pushed a commit to branch 1.3.2-release in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git
The following commit(s) were added to refs/heads/1.3.2-release by this push: new 3744167 [Fix-3364]Running the spark task fail because the can't find the jar (#3378) 3744167 is described below commit 3744167d52a52892b5ff98d3b07ab250970fdb5d Author: lgcareer <18610854...@163.com> AuthorDate: Mon Aug 3 10:31:27 2020 +0800 [Fix-3364]Running the spark task fail because the can't find the jar (#3378) --- .../dolphinscheduler/common/process/ResourceInfo.java | 16 ++++++++++++++++ .../master/consumer/TaskPriorityQueueConsumer.java | 2 +- .../dolphinscheduler/service/process/ProcessService.java | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ResourceInfo.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ResourceInfo.java index a7fc083..c460354 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ResourceInfo.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ResourceInfo.java @@ -43,5 +43,21 @@ public class ResourceInfo { this.res = res; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ResourceInfo that = (ResourceInfo) o; + + if (id != that.id) return false; + return res.equals(that.res); + } + + @Override + public int hashCode() { + int result = id; + result = 31 * result + res.hashCode(); + return result; + } } diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java index b1681bc..1a3bf6d 100644 --- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java +++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java @@ -385,7 +385,7 @@ public class TaskPriorityQueueConsumer extends Thread{ // get the resource id in order to get the resource names in batch Stream<Integer> resourceIdStream = projectResourceFiles.stream().map(resourceInfo -> resourceInfo.getId()); - Set<Integer> resourceIdsSet = resourceIdStream.collect(Collectors.toSet()); + Set<Integer> resourceIdsSet = resourceIdStream.filter(resId-> resId != 0).collect(Collectors.toSet()); if (CollectionUtils.isNotEmpty(resourceIdsSet)) { Integer[] resourceIds = resourceIdsSet.toArray(new Integer[resourceIdsSet.size()]); diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java index 617826c..40101fc 100644 --- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java +++ b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java @@ -1554,7 +1554,9 @@ public class ProcessService { * @return tenant code */ public String queryTenantCodeByResName(String resName,ResourceType resourceType){ - return resourceMapper.queryTenantCodeByResourceName(resName, resourceType.ordinal()); + // in order to query tenant code successful although the version is older + String fullName = resName.startsWith("/") ? resName : String.format("/%s",resName); + return resourceMapper.queryTenantCodeByResourceName(fullName, resourceType.ordinal()); } /**