[Groonga-commit] droonga/fluent-plugin-droonga at dcdaeb5 [master] output_adapter groonga: don't use input adapter for applying output adapter

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Jan 31 17:55:07 JST 2014


Kouhei Sutou	2014-01-31 17:55:07 +0900 (Fri, 31 Jan 2014)

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

  Message:
    output_adapter groonga: don't use input adapter for applying output adapter

  Modified files:
    lib/droonga/plugin/input_adapter/groonga.rb
    lib/droonga/plugin/output_adapter/groonga.rb

  Modified: lib/droonga/plugin/input_adapter/groonga.rb (+0 -15)
===================================================================
--- lib/droonga/plugin/input_adapter/groonga.rb    2014-01-31 17:52:56 +0900 (759bef3)
+++ lib/droonga/plugin/input_adapter/groonga.rb    2014-01-31 17:55:07 +0900 (8ad665f)
@@ -28,21 +28,6 @@ module Droonga
       input_message.command = "search"
       input_message.body = search_request
     end
-
-    command :table_create
-    def table_create(input_message)
-      input_message.add_route("groonga_generic_response")
-    end
-
-    command :table_remove
-    def table_remove(input_message)
-      input_message.add_route("groonga_generic_response")
-    end
-
-    command :column_create
-    def column_create(input_message)
-      input_message.add_route("groonga_generic_response")
-    end
   end
 end
 

  Modified: lib/droonga/plugin/output_adapter/groonga.rb (+8 -2)
===================================================================
--- lib/droonga/plugin/output_adapter/groonga.rb    2014-01-31 17:52:56 +0900 (7559eab)
+++ lib/droonga/plugin/output_adapter/groonga.rb    2014-01-31 17:55:07 +0900 (6538465)
@@ -25,8 +25,14 @@ module Droonga
       output_message.body = command.convert(output_message.body)
     end
 
-    command :groonga_generic_response
-    def groonga_generic_response(output_message)
+    groonga_results = [
+      "table_create.result",
+      "table_remove.result",
+      "column_create.result",
+    ]
+    command :convert_groonga_result,
+            :patterns => [["replyTo.type", :include?, *groonga_results]]
+    def convert_groonga_result(output_message)
       if output_message.body.include?("result")
         output_message.body = output_message.body["result"]
       end
-------------- next part --------------
HTML����������������������������...
다운로드 



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