Skip to content

Commit 7252bf3

Browse files
committed
review comments
1 parent d1587e3 commit 7252bf3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • master/src/main/scala/org/apache/celeborn/service/deploy/master/tags

master/src/main/scala/org/apache/celeborn/service/deploy/master/tags/TagsManager.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,18 @@ class TagsManager(configService: Option[ConfigService]) extends Logging {
5252
workers: util.List[WorkerInfo]): util.List[WorkerInfo] = {
5353

5454
val tags = resolveTagsExpr(userIdentifier, clientTagsExpr)
55-
.split(",").map(_.trim).filter(_.nonEmpty)
55+
.split(',').map(_.trim).filter(_.nonEmpty)
5656

5757
if (tags.isEmpty) {
5858
logDebug("No tags provided, returning all workers")
5959
return workers
6060
}
6161

62+
val store = tagStore
6263
val workerTagsPredicate = new Predicate[WorkerInfo] {
6364
override def test(w: WorkerInfo): Boolean = tags.forall { tag =>
6465
w.tags.contains(tag) ||
65-
tagStore.exists(_.getOrDefault(tag, Collections.emptySet()).contains(w.toUniqueId))
66+
store.flatMap(s => Option(s.get(tag))).exists(_.contains(w.toUniqueId))
6667
}
6768
}
6869
workers.stream().filter(workerTagsPredicate).collect(Collectors.toList())

0 commit comments

Comments
 (0)