[Groonga-commit] droonga/droonga-engine at 14de1e2 [master] Use droonga-send for droonga-engine-absorb-data

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Jul 28 14:19:09 JST 2014


YUKI Hiroshi	2014-07-28 14:19:09 +0900 (Mon, 28 Jul 2014)

  New Revision: 14de1e204d4492db62252f6f08eafeed38d648e8
  https://github.com/droonga/droonga-engine/commit/14de1e204d4492db62252f6f08eafeed38d648e8

  Message:
    Use droonga-send for droonga-engine-absorb-data

  Modified files:
    lib/droonga/command/serf_event_handler.rb
    lib/droonga/data_absorber.rb

  Modified: lib/droonga/command/serf_event_handler.rb (+2 -1)
===================================================================
--- lib/droonga/command/serf_event_handler.rb    2014-07-28 12:26:09 +0900 (70131b2)
+++ lib/droonga/command/serf_event_handler.rb    2014-07-28 14:19:09 +0900 (907382b)
@@ -322,7 +322,8 @@ module Droonga
                             :source_host      => source,
                             :destination_host => host,
                             :port             => port,
-                            :tag              => tag)
+                            :tag              => tag,
+                            :client           => "droonga-send")
         delete_status(:absorbing)
       end
 

  Modified: lib/droonga/data_absorber.rb (+14 -5)
===================================================================
--- lib/droonga/data_absorber.rb    2014-07-28 12:26:09 +0900 (88e6d84)
+++ lib/droonga/data_absorber.rb    2014-07-28 14:19:09 +0900 (ad60f95)
@@ -35,11 +35,20 @@ module Droonga
         #      processed.
         client = params[:client] || "droonga-request"
         client_options = []
-        client_options += ["--host", params[:destination_host]]
-        client_options += ["--port", params[:port].to_s] if params[:port]
-        client_options += ["--tag", params[:tag]] if params[:tag]
-        client_options += ["--receiver-host", params[:destination_host]]
-        client_options += ["--receiver-port", params[:receiver_port].to_s] if params[:receiver_port]
+        if client.include?("droonga-request")
+          client_options += ["--host", params[:destination_host]]
+          client_options += ["--port", params[:port].to_s] if params[:port]
+          client_options += ["--tag", params[:tag]] if params[:tag]
+          client_options += ["--receiver-host", params[:destination_host]]
+          client_options += ["--receiver-port", params[:receiver_port].to_s] if params[:receiver_port]
+        elsif client.include?("droonga-send")
+          server = "droonga:#{params[:destination_host]}"
+          server = "#{server}:#{params[:port].to_s}" if params[:port]
+          server = "#{server}/#{params[:tag].to_s}" if params[:tag]
+          client_options += ["--server", server]
+        else
+          raise ArgumentError.new("Unknwon type client: #{client}")
+        end
 
         drndump_command_line = [drndump] + drndump_options
         client_command_line = [client] + client_options
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index