Permalink
Browse files

Don't do repeated dumps of the nameserver for information we already …

…have for transform-tree.
  • Loading branch information...
1 parent 3e19cd4 commit 428ad2218ad36aff5c1278391513b49c233d7930 @rcohen rcohen committed Jan 31, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/gizzard/commands.rb
View
@@ -875,12 +875,15 @@ def get_transformations
transformations = {}
memoized_transforms = {}
+ memoized_manifests = {}
@argv.each_slice(2) do |(template_s, shard_id_s)|
to_template = ShardTemplate.parse(template_s)
shard_id = ShardId.parse(shard_id_s)
base_name = shard_id.table_prefix.split('_').first
forwarding = manager.get_forwarding_for_shard(shard_id)
- manifest = manifest_for_write(forwarding.table_id)
+ manifest = memoized_manifests.fetch(forwarding.table_id) do |t|
+ memoized_manifests[t] = manifest_for_write(t)
+ end
shard = manifest.trees[forwarding]
transform_args = [shard.template, to_template, copy_wrapper, skip_copies]

0 comments on commit 428ad22

Please sign in to comment.