liunaijie commented on code in PR #7045: URL: https://github.com/apache/seatunnel/pull/7045#discussion_r1650559302
########## seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/resourcemanager/AbstractResourceManager.java: ########## @@ -129,9 +131,45 @@ public void memberRemoved(MembershipServiceEvent event) { @Override public CompletableFuture<List<SlotProfile>> applyResources( - long jobId, List<ResourceProfile> resourceProfile) throws NoEnoughResourceException { + long jobId, List<ResourceProfile> resourceProfile, Map<String, String> tags) + throws NoEnoughResourceException { waitingWorkerRegister(); - return new ResourceRequestHandler(jobId, resourceProfile, registerWorker, this).request(); + ConcurrentMap<Address, WorkerProfile> matchedWorker; + if (tags == null || tags.isEmpty()) { + matchedWorker = registerWorker; + } else { + matchedWorker = + registerWorker.entrySet().stream() + .filter( + e -> { + Map<String, String> workerAttr = + e.getValue().getAttributes(); + if (workerAttr == null || workerAttr.isEmpty()) { + return true; + } Review Comment: fixed ########## seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/physical/PhysicalPlanGenerator.java: ########## @@ -150,7 +151,8 @@ public PhysicalPlanGenerator( } public Tuple2<PhysicalPlan, Map<Integer, CheckpointPlan>> generate() { - + Map<String, Object> envOptions = jobImmutableInformation.getJobConfig().getEnvOptions(); + Map<String, String> tags = JsonUtils.toMap(envOptions.getOrDefault("tag", "").toString()); Review Comment: done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@seatunnel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org