abhishekagarwal87 commented on code in PR #16162:
URL: https://github.com/apache/druid/pull/16162#discussion_r1531855558
##########
server/src/main/java/org/apache/druid/segment/realtime/appenderator/SegmentsAndCommitMetadata.java:
##########
@@ -20,28 +20,50 @@
package org.apache.druid.segment.realtime.appenderator;
import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
import org.apache.druid.segment.SegmentUtils;
import org.apache.druid.timeline.DataSegment;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
+import java.util.Set;
public class SegmentsAndCommitMetadata
{
private static final SegmentsAndCommitMetadata NIL = new
SegmentsAndCommitMetadata(Collections.emptyList(), null);
private final Object commitMetadata;
private final ImmutableList<DataSegment> segments;
+ private final ImmutableSet<DataSegment> upgradedSegments;
Review Comment:
please add a comment that these are extra versions created in case a replace
happened in between.
##########
server/src/main/java/org/apache/druid/segment/realtime/appenderator/BaseAppenderatorDriver.java:
##########
@@ -627,14 +628,19 @@ ListenableFuture<SegmentsAndCommitMetadata>
publishInBackground(
outputSegmentsAnnotateFunction,
callerMetadata
);
-
if (publishResult.isSuccess()) {
log.info(
"Published [%s] segments with commit metadata [%s]",
segmentsAndCommitMetadata.getSegments().size(),
callerMetadata
);
log.infoSegments(segmentsAndCommitMetadata.getSegments(),
"Published segments");
+ upgradedSegments.addAll(publishResult.getSegments());
Review Comment:
please add a commit that any extra published versions must be the upgraded
versions.
##########
server/src/main/java/org/apache/druid/segment/realtime/appenderator/BaseAppenderatorDriver.java:
##########
@@ -614,6 +614,7 @@ ListenableFuture<SegmentsAndCommitMetadata>
publishInBackground(
final Object callerMetadata = metadata == null
? null
: ((AppenderatorDriverMetadata)
metadata).getCallerMetadata();
+ final Set<DataSegment> upgradedSegments = new HashSet<>();
Review Comment:
this should be moved inside the retry block, right?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]