ctubbsii commented on code in PR #3405:
URL: https://github.com/apache/accumulo/pull/3405#discussion_r1222227783
##########
server/monitor/src/main/java/org/apache/accumulo/monitor/rest/manager/ManagerResource.java:
##########
@@ -79,11 +79,12 @@ public static ManagerInformation getTables(Monitor monitor)
{
String label = "";
if (gcStatusObj != null) {
long start = 0;
- if (gcStatusObj.current.started != 0 || gcStatusObj.currentLog.started
!= 0) {
- start = Math.max(gcStatusObj.current.started,
gcStatusObj.currentLog.started);
+ if (gcStatusObj.getCurrent().isSetStarted() ||
gcStatusObj.getCurrentLog().isSetStarted()) {
Review Comment:
Primitives can't be null. So a value of `0` could mean it was never set, or
it could mean that it was set explicitly to `0`. With `isSet...()` we can tell
the difference, because Thrift serializes extra information about whether the
`set...()` method was called. If we don't use that, we can't tell the
difference. That difference may or may not matter, depending. In some `if`
conditions, we want `is not set or is set to 0` vs. `is set to non-zero` and in
other cases we want `is not set` vs. `is set to anything`.
I'm not sure which is the case here.
--
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]