Skip to content

Commit

Permalink
Review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoe committed Nov 25, 2023
1 parent 4ca8cab commit 982e68f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.apache.druid.indexing.common.actions;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import org.apache.druid.indexing.common.task.Task;
Expand Down Expand Up @@ -64,10 +63,8 @@ public class RetrieveSegmentsToReplaceAction implements TaskAction<Collection<Da
{
private static final Logger log = new Logger(RetrieveSegmentsToReplaceAction.class);

@JsonIgnore
private final String dataSource;

@JsonIgnore
private final List<Interval> intervals;

@JsonCreator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ default Collection<DataSegment> retrieveUsedSegmentsForInterval(
/**
*
* Retrieve all published segments which are marked as used and the created_date of these segments belonging to the
* given data source and List<Interval> from the metadata store.
* given data source and list of intervals from the metadata store.
*
* Unlike other similar methods in this interface, this method doesn't accept a {@link Segments} "visibility"
* parameter. The returned collection may include overshadowed segments and their created_dates, as if {@link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,17 @@ public List<Pair<DataSegment, String>> retrieveUsedSegmentsAndCreatedDates(Strin
"SELECT created_date, payload FROM %1$s WHERE dataSource = :dataSource AND used = true"
);

boolean intervalsAreEternity = false;
boolean hasEternityInterval = false;
for (Interval interval : intervals) {
if (Intervals.isEternity(interval)) {
intervalsAreEternity = true;
hasEternityInterval = true;
break;
}
}

SqlSegmentsMetadataQuery.appendConditionForIntervalsAndMatchMode(
queryBuilder,
intervalsAreEternity ? Collections.emptyList() : intervals,
hasEternityInterval ? Collections.emptyList() : intervals,
SqlSegmentsMetadataQuery.IntervalMode.OVERLAPS,
connector
);
Expand Down

0 comments on commit 982e68f

Please sign in to comment.