diff --git a/lib/gizzard/nameserver.rb b/lib/gizzard/nameserver.rb index 42f2c2d..2fbb79e 100644 --- a/lib/gizzard/nameserver.rb +++ b/lib/gizzard/nameserver.rb @@ -108,6 +108,12 @@ def get_shards(ids) ids.map {|id| with_retry { client.get_shard(id) } } end + def reload_updated_forwardings + parallel_map all_clients do |c| + with_retry { c.reload_config } + end + end + def reload_config parallel_map all_clients do |c| with_retry { c.reload_config } diff --git a/lib/gizzard/thrift.rb b/lib/gizzard/thrift.rb index 439c1bb..c7e598f 100755 --- a/lib/gizzard/thrift.rb +++ b/lib/gizzard/thrift.rb @@ -150,6 +150,7 @@ def printable(method_name, args, timestamp = false) end class Manager < GizzmoService + thrift_method :reload_updated_forwardings, void, :throws => exception(GizzardException) thrift_method :reload_config, void, :throws => exception(GizzardException) thrift_method :rebuild_schema, void, :throws => exception(GizzardException) diff --git a/lib/gizzard/transformation_scheduler.rb b/lib/gizzard/transformation_scheduler.rb index 0b96935..0f0dc57 100644 --- a/lib/gizzard/transformation_scheduler.rb +++ b/lib/gizzard/transformation_scheduler.rb @@ -67,7 +67,7 @@ def apply! end end - nameserver.reload_config + nameserver.reload_updated_forwardings log "#{@jobs_finished.length} transformation#{'s' if @jobs_finished.length > 1} applied. Total time elapsed: #{time_elapsed}" end @@ -96,7 +96,7 @@ def schedule_jobs(num_to_schedule) j.prepare!(nameserver) end - nameserver.reload_config + nameserver.reload_updated_forwardings copy_jobs = jobs.select {|j| j.copy_required? }