Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce high zoom "long tail" of jobs #370

Merged
merged 2 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tilequeue/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -2096,8 +2096,6 @@ def tilequeue_meta_tile(cfg, args):
parent = deserialize_coord(coord_str)
assert parent, 'Invalid coordinate: %s' % coord_str

assert parent.zoom == queue_zoom, 'Unexpected zoom: %s' % coord_str

with open(cfg.query_cfg) as query_cfg_fp:
query_cfg = yaml.load(query_cfg_fp)

Expand All @@ -2116,6 +2114,10 @@ def tilequeue_meta_tile(cfg, args):
group_by_zoom = rawr_yaml.get('group-zoom')
assert group_by_zoom is not None, 'Missing group-zoom rawr config'

assert queue_zoom <= parent.zoom <= group_by_zoom, \
'Unexpected zoom: %s, zoom should be between %d and %d' % \
(coord_str, queue_zoom, group_by_zoom)

# NOTE: max_zoom looks to be inclusive
zoom_stop = cfg.max_zoom
assert zoom_stop > group_by_zoom
Expand Down Expand Up @@ -2252,7 +2254,9 @@ def tilequeue_meta_tile_low_zoom(cfg, args):
meta_low_zoom_logger.begin_run(parent)

coords = [parent]
if parent.zoom == queue_zoom:
# we don't include tiles at group_by_zoom, so unless parent.zoom is
# _more_ than one zoom level less, we don't need to include the pyramid.
if parent.zoom == queue_zoom and parent.zoom < group_by_zoom - 1:
# we will be multiple meta tile coordinates in this run
coords.extend(coord_children_range(parent, group_by_zoom - 1))

Expand Down
3 changes: 2 additions & 1 deletion tilequeue/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ def coord_children(coord):


def coord_children_range(coord, zoom_until):
assert zoom_until > coord.zoom
assert zoom_until > coord.zoom, 'zoom_until (%r) must be > coord.zoom ' \
'(%r)' % (zoom_until, coord)
for child in coord_children_subrange(coord, coord.zoom + 1, zoom_until):
yield child

Expand Down