[Groonga-commit] droonga/fluent-plugin-droonga at 8318013 [master] Remove handler and job queue from executor

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Nov 24 17:40:03 JST 2013


Kouhei Sutou	2013-11-24 17:40:03 +0900 (Sun, 24 Nov 2013)

  New Revision: 83180134dc1000d19facef4a0d18d321f8a14ad2
  https://github.com/droonga/fluent-plugin-droonga/commit/83180134dc1000d19facef4a0d18d321f8a14ad2

  Message:
    Remove handler and job queue from executor
    
    Now, handler and job queue codes were moved to processor.

  Modified files:
    lib/droonga/executor.rb

  Modified: lib/droonga/executor.rb (+2 -44)
===================================================================
--- lib/droonga/executor.rb    2013-11-24 17:36:35 +0900 (99e600c)
+++ lib/droonga/executor.rb    2013-11-24 17:40:03 +0900 (1a27725)
@@ -19,8 +19,7 @@ require "fluent-logger"
 require "fluent/logger/fluent_logger"
 require "groonga"
 
-require "droonga/job_queue"
-require "droonga/handler_plugin"
+require "droonga/legacy_plugin"
 require "droonga/plugin_loader"
 require "droonga/dispatcher"
 
@@ -36,9 +35,8 @@ module Droonga
       @database_name = options[:database]
       @queue_name = options[:queue_name] || "DroongaQueue"
       @pool_size = options[:n_workers] || 0
-#     load_handlers
+#     load_plugins
       Droonga::PluginLoader.load_all
-      @handler = Handler.new(@options)
       prepare
     end
 
@@ -47,7 +45,6 @@ module Droonga
       @legacy_plugins.each do |legacy_plugin|
         legacy_plugin.shutdown
       end
-      @handler.shutdown
       @outputs.each do |dest, output|
         output[:logger].close if output[:logger]
       end
@@ -56,10 +53,6 @@ module Droonga
         @context.close
         @database = @context = nil
       end
-      if @job_queue
-        @job_queue.close
-        @job_queue = nil
-      end
       $log.trace("#{log_tag}: shutdown: done")
     end
 
@@ -90,25 +83,6 @@ module Droonga
       $log.trace("#{log_tag}: dispatch: done")
     end
 
-    def execute_one
-      $log.trace("#{log_tag}: execute_one: start")
-      message = @job_queue.pull_message
-      unless message
-        $log.trace("#{log_tag}: execute_one: abort: no message")
-        return
-      end
-      body, command, arguments = parse_message(message)
-      legacy_plugin = find_legacy_plugin(command)
-      if legacy_plugin
-        $log.trace("#{log_tag}: execute_one: handle: start",
-                   :hander => legacy_plugin.class)
-        legacy_plugin.handle(command, body, *arguments)
-        $log.trace("#{log_tag}: execute_one: handle: done",
-                   :hander => legacy_plugin.class)
-      end
-      $log.trace("#{log_tag}: execute_one: done")
-    end
-
     def post(body, destination=nil)
       $log.trace("#{log_tag}: post: start")
       post_or_push(nil, body, destination)
@@ -148,21 +122,6 @@ module Droonga
           legacy_plugin.handle(command, body, *arguments)
           $log.trace("#{log_tag}: post_or_push: handle: done: <#{command}>",
                      :plugin => legacy_plugin.class)
-        elsif****@handl*****?(command)
-          if synchronous.nil?
-            synchronous =****@handl*****_synchronous?(command)
-          end
-          if route || @pool_size.zero? || synchronous
-            @handler.handle(@message)
-          else
-            unless message
-              envelope["body"] = body
-              envelope["type"] = command
-              envelope["arguments"] = arguments
-              message = ['', Time.now.to_f, envelope]
-            end
-            @job_queue.push_message(message)
-          end
         end
       end
       add_route(route) if route
@@ -238,7 +197,6 @@ module Droonga
       if @database_name && !@database_name.empty?
         @context = Groonga::Context.new
         @database =****@conte*****_database(@database_name)
-        @job_queue = JobQueue.open(@database_name, @queue_name)
       end
       add_legacy_plugin("dispatcher_message")
     end
-------------- next part --------------
HTML����������������������������...
Download 



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