Skip to content

Commit

Permalink
Check up-front if a track defines corpora
Browse files Browse the repository at this point in the history
Relates #555
  • Loading branch information
danielmitterdorfer committed Sep 4, 2018
1 parent 70012c7 commit 056329c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions esrally/track/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,15 @@ def operation_parameters(t, op):

def used_corpora(t, cfg):
corpora = {}
challenge = t.find_challenge_or_default(cfg.opts("track", "challenge.name"))
for task in challenge.schedule:
for sub_task in task:
param_source = operation_parameters(t, sub_task.operation)
if hasattr(param_source, "corpora"):
for c in param_source.corpora:
# We might have the same corpus *but* they contain different doc sets. Therefore also need to union over doc sets.
corpora[c.name] = corpora.get(c.name, c).union(c)
if t.corpora:
challenge = t.find_challenge_or_default(cfg.opts("track", "challenge.name"))
for task in challenge.schedule:
for sub_task in task:
param_source = operation_parameters(t, sub_task.operation)
if hasattr(param_source, "corpora"):
for c in param_source.corpora:
# We might have the same corpus *but* they contain different doc sets. Therefore also need to union over doc sets.
corpora[c.name] = corpora.get(c.name, c).union(c)
return corpora.values()


Expand Down

0 comments on commit 056329c

Please sign in to comment.