jon-wei commented on a change in pull request #8870: Additional Kinesis 
resharding fixes
URL: https://github.com/apache/incubator-druid/pull/8870#discussion_r350569696
 
 

 ##########
 File path: 
indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentTransactionalInsertAction.java
 ##########
 @@ -79,21 +81,32 @@ public static SegmentTransactionalInsertAction 
appendAction(
       @Nullable DataSourceMetadata endMetadata
   )
   {
-    return new SegmentTransactionalInsertAction(null, segments, startMetadata, 
endMetadata);
+    return new SegmentTransactionalInsertAction(null, segments, startMetadata, 
endMetadata, null);
+  }
+
+  public static SegmentTransactionalInsertAction commitMetadataOnlyAction(
+      String dataSource,
+      DataSourceMetadata startMetadata,
+      DataSourceMetadata endMetadata
+  )
+  {
+    return new SegmentTransactionalInsertAction(null, null, startMetadata, 
endMetadata, dataSource);
   }
 
   @JsonCreator
   private SegmentTransactionalInsertAction(
       @JsonProperty("segmentsToBeOverwritten") @Nullable Set<DataSegment> 
segmentsToBeOverwritten,
-      @JsonProperty("segments") Set<DataSegment> segments,
+      @JsonProperty("segments") @Nullable Set<DataSegment> segments,
       @JsonProperty("startMetadata") @Nullable DataSourceMetadata 
startMetadata,
-      @JsonProperty("endMetadata") @Nullable DataSourceMetadata endMetadata
+      @JsonProperty("endMetadata") @Nullable DataSourceMetadata endMetadata,
+      @JsonProperty("dataSource") @Nullable String dataSource
   )
   {
     this.segmentsToBeOverwritten = segmentsToBeOverwritten;
-    this.segments = ImmutableSet.copyOf(segments);
+    this.segments = segments == null ? ImmutableSet.of() : 
ImmutableSet.copyOf(segments);
 
 Review comment:
   Noting here about rolling upgrade behavior:
   - With a new overlord and old task, the old task won't create this action 
when it created no segments
   - With an old overlord and a new task, the new task's metadata commit will 
fail here when the action is deserialized on the overlord at 
`ImmutableSet.copyOf(segments)` since `segments` would be null

----------------------------------------------------------------
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]

Reply via email to