You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/02/13 00:34:50 UTC

[GitHub] glasser commented on a change in pull request #7046: index_parallel: support !appendToExisting with no explicit intervals

glasser commented on a change in pull request #7046: index_parallel: support !appendToExisting with no explicit intervals
URL: https://github.com/apache/incubator-druid/pull/7046#discussion_r256205585
 
 

 ##########
 File path: indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java
 ##########
 @@ -360,43 +362,77 @@ SegmentIdWithShardSpec allocateNewSegment(DateTime timestamp) throws IOException
   {
     final String dataSource = getDataSource();
     final GranularitySpec granularitySpec = getIngestionSchema().getDataSchema().getGranularitySpec();
-    final SortedSet<Interval> bucketIntervals = Preconditions.checkNotNull(
-        granularitySpec.bucketIntervals().orNull(),
-        "bucketIntervals"
-    );
+    final Optional<SortedSet<Interval>> bucketIntervals = granularitySpec.bucketIntervals();
+
     // List locks whenever allocating a new segment because locks might be revoked and no longer valid.
     final Map<Interval, String> versions = toolbox
         .getTaskActionClient()
         .submit(new LockListAction())
         .stream()
+        // FIXME note that the next line is new in this commit --- it's not relevant for fixing #6989,
+        //       it just seems like a bug fix to make the code match its comment
 
 Review comment:
   The reason I think the current code doesn't match is comment is that if we didn't care about checking for revoked locks, we wouldn't need to run LockListAction again – we could just remember the versions we got when we took the locks out at the beginning of the task.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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