mirror of https://github.com/apache/druid.git
fix retry logic
This commit is contained in:
parent
469ccbbe5e
commit
257fb3f18e
|
@ -27,6 +27,7 @@ import com.metamx.common.guava.Sequence;
|
|||
import com.metamx.common.guava.Yielder;
|
||||
import com.metamx.common.guava.YieldingAccumulator;
|
||||
import com.metamx.common.guava.YieldingSequenceBase;
|
||||
import io.druid.query.spec.MultipleSpecificSegmentSpec;
|
||||
import io.druid.segment.SegmentMissingException;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -73,7 +74,12 @@ public class RetryQueryRunner<T> implements QueryRunner<T>
|
|||
|
||||
for (int i = 0; i < config.numTries(); i++) {
|
||||
context.put(MISSING_SEGMENTS_KEY, Lists.newArrayList());
|
||||
yielder = baseRunner.run(query, context).toYielder(initValue, accumulator);
|
||||
final Query<T> retryQuery = query.withQuerySegmentSpec(
|
||||
new MultipleSpecificSegmentSpec(
|
||||
missingSegments
|
||||
)
|
||||
);
|
||||
yielder = baseRunner.run(retryQuery, context).toYielder(initValue, accumulator);
|
||||
if (getMissingSegments(context).isEmpty()) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue