fix retry logic

This commit is contained in:
fjy 2014-09-12 15:47:41 -07:00
parent 469ccbbe5e
commit 257fb3f18e
1 changed files with 8 additions and 2 deletions

View File

@ -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;
}