[Groonga-commit] droonga/fluent-plugin-droonga at 8d7b2e1 [master] Define "sum" type reducer as a constant

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Feb 3 12:24:14 JST 2014


YUKI Hiroshi	2014-02-03 12:24:14 +0900 (Mon, 03 Feb 2014)

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

  Message:
    Define "sum" type reducer as a constant

  Modified files:
    lib/droonga/distributed_command_planner.rb

  Modified: lib/droonga/distributed_command_planner.rb (+7 -3)
===================================================================
--- lib/droonga/distributed_command_planner.rb    2014-02-03 12:19:29 +0900 (f74d954)
+++ lib/droonga/distributed_command_planner.rb    2014-02-03 12:24:14 +0900 (b811e9c)
@@ -20,6 +20,10 @@ module Droonga
     attr_accessor :key, :dataset
     attr_reader :messages
 
+    REDUCE_SUM = "sum"
+
+    DEFAULT_LIMIT = -1
+
     def initialize(source_message)
       @source_message = source_message
 
@@ -137,8 +141,8 @@ module Droonga
         reducer = {
           "type" => reducer,
         }
-        if reducer["type"] == "sum"
-          reducer["limit"] = -1
+        if reducer["type"] == REDUCE_SUM
+          reducer["limit"] = DEFAULT_LIMIT
         end
       end
       {
@@ -176,7 +180,7 @@ module Droonga
     #    cannot use their custom "errors" in the body.
     #    This must be rewritten. 
     def plan_errors_handling
-      reduce("errors"=> { "type" => "sum", "limit" => -1 })
+      reduce("errors"=> REDUCE_SUM)
     end
   end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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