jihoonson commented on a change in pull request #9274: Refactoring some codes
around ingestion
URL: https://github.com/apache/druid/pull/9274#discussion_r374439378
##########
File path:
indexing-service/src/main/java/org/apache/druid/indexing/common/task/LocalSegmentAllocator.java
##########
@@ -67,30 +64,25 @@
}
final Interval interval = maybeInterval.get();
- final String version = intervalToVersion.entrySet().stream()
- .filter(entry ->
entry.getKey().contains(interval))
- .map(Entry::getValue)
- .findFirst()
- .orElseThrow(() -> new
ISE("Cannot find a version for interval[%s]", interval));
+ final String version = intervalToVersion
+ .entrySet()
+ .stream()
+ .filter(entry -> entry.getKey().contains(interval))
+ .map(Entry::getValue)
+ .findFirst()
+ .orElseThrow(() -> new ISE("Cannot find a version for interval[%s]",
interval));
- final int partitionNum = counters.computeIfAbsent(interval, x -> new
AtomicInteger()).getAndIncrement();
+ final int partitionId = counters.computeIfAbsent(interval, x -> new
MutableInt()).getAndIncrement();
Review comment:
It doesn't have to be an `AtomicInteger` since there's no concurrent update.
----------------------------------------------------------------
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.
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]