kevinrr888 commented on PR #5364:
URL: https://github.com/apache/accumulo/pull/5364#issuecomment-2691097869
> If possible it would be better to set running and queued to new atomic
integers when they are declared and make them final
From this, realized we can do
```
if (registry != null) {
this.queued = registry.gauge(METRICS_MAJC_QUEUED, Tags.of("id",
ceid.canonical()),
new AtomicInteger(0));
this.running = registry.gauge(METRICS_MAJC_RUNNING, Tags.of("id",
ceid.canonical()),
new AtomicInteger(0));
} else {
// these vars have no effect on metrics in this case - just avoids
NPEs
this.queued = new AtomicInteger(0);
this.running = new AtomicInteger(0);
}
```
In the second case, we avoid NPEs and these don't have any effect on the
metrics. Does this seem correct? Did you have something else in mind?
--
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]