YUKI Hiroshi
null+****@clear*****
Tue Apr 14 12:19:50 JST 2015
YUKI Hiroshi 2015-04-14 12:19:50 +0900 (Tue, 14 Apr 2015) New Revision: ea38c60f88392cab211846ade81f3452e2009ea3 https://github.com/droonga/droonga-engine/commit/ea38c60f88392cab211846ade81f3452e2009ea3 Message: Collect similar methods Modified files: lib/droonga/plugins/system/absorb_data.rb Modified: lib/droonga/plugins/system/absorb_data.rb (+20 -20) =================================================================== --- lib/droonga/plugins/system/absorb_data.rb 2015-04-14 12:19:31 +0900 (c00f6ff) +++ lib/droonga/plugins/system/absorb_data.rb 2015-04-14 12:19:50 +0900 (2c6b34c) @@ -179,26 +179,6 @@ module Droonga Catalog::Dataset::DEFAULT_NAME end - def get_source_tables(&block) - source_client.request("dataset" => source_dataset, - "type" => "table_list") do |response| - unless response - raise EmptyResponse.new("table_list returns nil response") - end - unless response["body"] - raise EmptyBody.new("table_list returns nil result") - end - - message_body = response["body"] - body = message_body[1] - tables = body[1..-1] - table_names = tables.collect do |table| - table[1] - end - yield(table_names) - end - end - def source_client_options { :host => source_host, @@ -220,6 +200,26 @@ module Droonga @source_client ||= Droonga::Client.new(source_client_options) end + def get_source_tables(&block) + source_client.request("dataset" => source_dataset, + "type" => "table_list") do |response| + unless response + raise EmptyResponse.new("table_list returns nil response") + end + unless response["body"] + raise EmptyBody.new("table_list returns nil result") + end + + message_body = response["body"] + body = message_body[1] + tables = body[1..-1] + table_names = tables.collect do |table| + table[1] + end + yield(table_names) + end + end + def get_total_n_source_records(&block) get_source_tables do |source_tables| queries = {} -------------- next part -------------- HTML����������������������������... Descargar