Skip to content

Commit

Permalink
[COST] fix BrokerDiskSpaceCost (#1757)
Browse files Browse the repository at this point in the history
  • Loading branch information
qoo332001 authored May 18, 2023
1 parent a43d47a commit c75bcb4
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ static boolean brokerDiskUsageSizeOverflow(
(Long)
after
.replicaStream(id)
.filter(r -> before.replicaStream(id).noneMatch(r::equals))
.map(Replica::size)
.mapToLong(y -> y)
.filter(r -> !before.replicas(r.topicPartition()).contains(r))
.mapToLong(Replica::size)
.sum();
if ((beforeSize + addedSize)
> brokerMoveCostLimit.getOrDefault(id, DataSize.Byte.of(Long.MAX_VALUE)).bytes())
Expand Down Expand Up @@ -115,9 +114,8 @@ static boolean brokerPathDiskUsageSizeOverflow(
(Long)
after
.replicaStream(brokerPaths.getKey())
.filter(r -> before.replicaStream(brokerPaths.getKey()).noneMatch(r::equals))
.map(Replica::size)
.mapToLong(y -> y)
.filter(r -> !before.replicas(r.topicPartition()).contains(r))
.mapToLong(Replica::size)
.sum();
if ((beforeSize + addedSize)
> diskMoveCostLimit.getOrDefault(brokerPath, DataSize.Byte.of(Long.MAX_VALUE)).bytes())
Expand Down

0 comments on commit c75bcb4

Please sign in to comment.