jihoonson commented on a change in pull request #7547: Add support minor
compaction with segment locking
URL: https://github.com/apache/incubator-druid/pull/7547#discussion_r299685199
##########
File path:
core/src/main/java/org/apache/druid/timeline/VersionedIntervalTimeline.java
##########
@@ -453,39 +485,60 @@ private boolean addAtKey(
}
while (entryInterval != null && currKey != null &&
currKey.overlaps(entryInterval)) {
- Interval nextKey = timeline.higherKey(currKey);
+ final Interval nextKey = timeline.higherKey(currKey);
- int versionCompare = versionComparator.compare(
+ final int versionCompare = versionComparator.compare(
entry.getVersion(),
timeline.get(currKey).getVersion()
);
if (versionCompare < 0) {
+ // since the entry version is lower than the existing one, the
existing one overwrites the given entry if overlapped.
if (currKey.contains(entryInterval)) {
+ // the version of the entry of currKey is larger than that of the
given entry. Discard it
return true;
} else if (currKey.getStart().isBefore(entryInterval.getStart())) {
+ // | cur |
+ // | entry |
+ // => |new|
entryInterval = new Interval(currKey.getEnd(),
entryInterval.getEnd());
} else {
+ // | entry |
+ // | cur |
+ // => |new|
addIntervalToTimeline(new Interval(entryInterval.getStart(),
currKey.getStart()), entry, timeline);
+ // | entry |
Review comment:
Thanks, added.
----------------------------------------------------------------
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]