[Groonga-commit] droonga/fluent-plugin-droonga at ba3b256 [master] Validate partitions

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 12 15:53:49 JST 2014


YUKI Hiroshi	2014-02-12 15:53:49 +0900 (Wed, 12 Feb 2014)

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

  Message:
    Validate partitions

  Modified files:
    lib/droonga/catalog/base.rb

  Modified: lib/droonga/catalog/base.rb (+15 -0)
===================================================================
--- lib/droonga/catalog/base.rb    2014-02-12 15:37:37 +0900 (f68e940)
+++ lib/droonga/catalog/base.rb    2014-02-12 15:53:49 +0900 (ec1581b)
@@ -253,6 +253,21 @@ module Droonga
         validate_parameter_type(ring, name, Hash)
 
         validate_positive_numeric_parameter(ring["weight"], "#{name}.weight")
+
+        validate_parameter_type(ring["partitions"],
+                                "#{name}.partitions",
+                                Hash)
+        ring["partitions"].each do |key, value|
+          validate_ring(value, "#{name}.partitions.#{key}")
+        end
+      end
+
+      def validate_partition(partition, name)
+        validate_parameter_type(partition, name, Array)
+
+        partition.each_with_index do |value, index|
+          validate_parameter_type(value, "#{name}[#{index}]", String)
+        end
       end
     end
   end
-------------- next part --------------
HTML����������������������������...
Download 



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