Skip to content

Commit

Permalink
fixup! [FLINK-14869][core] Discard zero-valued extended resources in …
Browse files Browse the repository at this point in the history
…ResourceProfile
  • Loading branch information
xintongsong committed Feb 18, 2021
1 parent 1bd2d3d commit 216d83a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private ResourceProfile(

this.extendedResources =
checkNotNull(extendedResources).entrySet().stream()
.filter(entry -> entry.getValue() != null && !entry.getValue().isZero())
.filter(entry -> !checkNotNull(entry.getValue()).isZero())
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
}

Expand Down Expand Up @@ -463,7 +463,7 @@ public ResourceProfile multiply(final int multiplier) {
Tuple2.of(
entry.getKey(),
entry.getValue().multiply(multiplier)))
.filter(tuple -> tuple.f1 != null && !tuple.f1.isZero())
.filter(tuple -> !tuple.f1.isZero())
.collect(Collectors.toMap(tuple -> tuple.f0, tuple -> tuple.f1));

return new ResourceProfile(
Expand Down

0 comments on commit 216d83a

Please sign in to comment.