Navigation Menu

Skip to content

Commit

Permalink
Use droonga-engine
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 22, 2014
1 parent 7a739c3 commit ddff48a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
8 changes: 4 additions & 4 deletions Gemfile
Expand Up @@ -9,11 +9,11 @@ gem "cool.io"
gem "test-unit", :require => false

base_dir = File.dirname(__FILE__)
local_fluent_plugin_droonga = File.join(base_dir, "..", "fluent-plugin-droonga")
if File.exist?(local_fluent_plugin_droonga)
gem "fluent-plugin-droonga", :path => local_fluent_plugin_droonga
local_droonga_engine = File.join(base_dir, "..", "droonga-engine")
if File.exist?(local_droonga_engine)
gem "droonga-engine", :path => local_droonga_engine
else
gem "fluent-plugin-droonga", :github => "droonga/fluent-plugin-droonga"
gem "droonga-engine", :github => "droonga/droonga-engine"
end

local_droonga_client_ruby = File.join(base_dir, "..", "droonga-client-ruby")
Expand Down
23 changes: 4 additions & 19 deletions lib/wikipedia-search/task.rb
Expand Up @@ -217,23 +217,6 @@ def droonga_port(node_id)
24000 + node_id
end

def droonga_generate_fluentd_conf(node_id)
fluend_conf_path = @path.droonga.fluentd_conf(node_id)
fluend_conf_path.open("w") do |fluend_conf|
port = droonga_port(node_id)
fluend_conf.puts(<<-CONF)
<source>
type forward
port #{port}
</source>
<match droonga.message>
type droonga
name 127.0.0.1:#{port}/droonga
</match>
CONF
end
end

def droonga_generate_catalog(node_ids)
replicas_path = @path.droonga.working_dir + "replicas.json"
replicas_path.open("w") do |replicas_file|
Expand Down Expand Up @@ -262,8 +245,10 @@ def droonga_generate_catalog(node_ids)
end

def droonga_run_engine(node_id)
spawn("fluentd",
"--config", @path.droonga.fluentd_conf(node_id).expand_path.to_s,
spawn("droonga-engine",
"--host", "127.0.0.1",
"--port", droonga_port(node_id).to_s,
"--tag", "droonga",
:chdir => @path.droonga.working_dir.to_s)
end

Expand Down

0 comments on commit ddff48a

Please sign in to comment.