isaacreath commented on code in PR #4547:
URL: https://github.com/apache/cassandra/pull/4547#discussion_r2688148567
##########
src/java/org/apache/cassandra/service/disk/usage/DiskUsageBroadcaster.java:
##########
@@ -83,6 +89,74 @@ public boolean isStuffed(InetAddressAndPort endpoint)
return state(endpoint).isStuffed();
}
+ /**
+ * @return {@code true} if there exists any node in the datacenter of
{@code endpoint} which has FULL disk usage.
+ */
+ public boolean isDataCenterFull(InetAddressAndPort endpoint)
+ {
+ if (!hasStuffedOrFullNode())
+ {
+ return false;
+ }
+ Locator locator = DatabaseDescriptor.getLocator();
Review Comment:
There is a small window in the startup sequence where
`DatabaseDescriptor.getLocator()` could return null and will later return a
locator instance. I think practically we won't ever this the case where it is
null by the time we are creating the `DiskUsageBroadcaster`, but I think out of
safety it makes sense to ask for it from the `DatabaseDescriptor`. We could
store it as a class variable and only pull it from the `DatabaseDescriptor`
when our class variable is null but that seems like it would be more
complicated.
--
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]