jihoonson commented on a change in pull request #6657: Add
TaskCountStatsMonitor to monitor task count stats
URL: https://github.com/apache/incubator-druid/pull/6657#discussion_r236912207
##########
File path:
indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskQueue.java
##########
@@ -510,6 +518,14 @@ private void handleStatus(final TaskStatus status)
task,
status.getDuration()
);
+
+ if (status.isSuccess()) {
+
totalSuccessfulTaskCount.computeIfAbsent(task.getDataSource(), k -> new
AtomicLong());
+
totalSuccessfulTaskCount.get(task.getDataSource()).incrementAndGet();
Review comment:
`computeIfAbsent()` returns the proper instance of `AtomicLong`, so you can
just call `incrementAndGet()` directly on that instance like below. This is
better because we can avoid unnecessary `get()`.
```java
totalSuccessfulTaskCount.computeIfAbsent(task.getDataSource(), k -> new
AtomicLong())
.incrementAndGet();
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]