You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "github-code-scanning[bot] (via GitHub)" <gi...@apache.org> on 2023/02/06 04:25:25 UTC

[GitHub] [druid] github-code-scanning[bot] commented on a diff in pull request #13706: Generate tombstones when running MSQ's replace

github-code-scanning[bot] commented on code in PR #13706:
URL: https://github.com/apache/druid/pull/13706#discussion_r1096932621


##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/TombstoneHelper.java:
##########
@@ -122,10 +125,108 @@
     return retVal;
   }
 
-  private DataSegment createTombstoneForTimeChunkInterval(String dataSource, String version, ShardSpec shardSpec, Interval timeChunkInterval)
+  public Set<DataSegment> computeTombstonesForReplace(
+      List<Interval> intervalsToDrop,
+      List<Interval> intervalsToReplace,
+      String dataSource,
+      Granularity replaceGranularity
+  ) throws IOException
   {
+    Set<Interval> tombstoneIntervals = computeTombstoneIntervalsForReplace(
+        intervalsToReplace,
+        intervalsToDrop,
+        dataSource,
+        replaceGranularity
+    );
+    Set<DataSegment> tombstones = new HashSet<>();
+    for (Interval tombstoneInterval : tombstoneIntervals) {
 
+      final List<TaskLock> locks = taskActionClient.submit(new LockListAction());
+      String version = null;
+      for (final TaskLock lock : locks) {
+        if (lock.getInterval().contains(tombstoneInterval)) {
+          version = lock.getVersion();
+        }
+      }
 
+      if (version == null) {
+        // Unable to fetch the version number of the segment
+        throw new ISE("Unable to fetch the version of the segments in use. The lock for the task might"
+                      + "have been revoked");

Review Comment:
   ## Missing space in string literal
   
   This string appears to be missing a space after 'might'.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/4233)



-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org