smiklosovic commented on code in PR #4547:
URL: https://github.com/apache/cassandra/pull/4547#discussion_r2687710023
##########
src/java/org/apache/cassandra/service/disk/usage/DiskUsageBroadcaster.java:
##########
@@ -164,10 +313,36 @@ public void onRestart(InetAddressAndPort endpoint,
EndpointState state)
@Override
public void onRemove(InetAddressAndPort endpoint)
{
+ DiskUsageState usageState = usageInfo.getOrDefault(endpoint,
DiskUsageState.NOT_AVAILABLE);
+ updateDiskUsageStateForDatacenterOnRemoval(endpoint, usageState);
usageInfo.remove(endpoint);
hasStuffedOrFullNode =
usageInfo.values().stream().anyMatch(DiskUsageState::isStuffedOrFull);
}
+ private void updateDiskUsageStateForDatacenterOnRemoval(InetAddressAndPort
endpoint, DiskUsageState usageState)
+ {
+ Locator locator = DatabaseDescriptor.getLocator();
Review Comment:
there seems to be a lot of duplicity around this locator / location logic,
copying it over from other places, maybe extracting that to a standalone method
and having it like a one-liner here would be more readable.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]