[Groonga-commit] groonga/fluent-plugin-droonga at 015a9b2 [master] Replace all the keys of args from symbol to string.

Back to archive index

Daijiro MORI null+****@clear*****
Tue Aug 13 18:07:13 JST 2013


Daijiro MORI	2013-08-13 18:07:13 +0900 (Tue, 13 Aug 2013)

  New Revision: 015a9b2e0dca4d942dbd55167c3611f73e795bc9
  https://github.com/groonga/fluent-plugin-droonga/commit/015a9b2e0dca4d942dbd55167c3611f73e795bc9

  Message:
    Replace all the keys of args from symbol to string.

  Modified files:
    lib/droonga/catalog.rb

  Modified: lib/droonga/catalog.rb (+9 -9)
===================================================================
--- lib/droonga/catalog.rb    2013-08-09 16:00:40 +0900 (0d8c9c9)
+++ lib/droonga/catalog.rb    2013-08-13 18:07:13 +0900 (265b4fb)
@@ -54,13 +54,13 @@ module Droonga
       routes = []
       dataset = dataset(name)
       return routes unless dataset
-      case args[:type]
-      when :broadcast
+      case args["type"]
+      when "broadcast"
         dataset["ring"].each do |key, partition|
           select_range_and_replicas(partition, args, routes)
         end
-      when :scatter
-        name = get_partition(dataset, args[:key])
+      when "scatter"
+        name = get_partition(dataset, args["key"])
         partition = dataset["ring"][name]
         select_range_and_replicas(partition, args, routes)
       end
@@ -91,14 +91,14 @@ module Droonga
     end
 
     def select_range_and_replicas(partition, args, routes)
-      date_range = args[:date_range] || 0..-1
+      date_range = args["date_range"] || 0..-1
       partition["partitions"].sort[date_range].each do |time, replicas|
-        case args[:replica]
-        when :top
+        case args["replica"]
+        when "top"
           routes << replicas[0]
-        when :random
+        when "random"
           routes << replicas[rand(replicas.size)]
-        when :all
+        when "all"
           routes.concat(replicas)
         end
       end
-------------- next part --------------
HTML����������������������������...
Télécharger 



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