[Groonga-commit] droonga/fluent-plugin-droonga at 26073a0 [master] Validate partition_key

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 12 17:30:22 JST 2014


YUKI Hiroshi	2014-02-12 17:30:22 +0900 (Wed, 12 Feb 2014)

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

  Message:
    Validate partition_key

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

  Modified: lib/droonga/catalog/base.rb (+7 -0)
===================================================================
--- lib/droonga/catalog/base.rb    2014-02-12 17:18:57 +0900 (a73436b)
+++ lib/droonga/catalog/base.rb    2014-02-12 17:30:22 +0900 (66f1987)
@@ -291,6 +291,8 @@ module Droonga
         validate_positive_integer_parameter(dataset["workers"],
                                             "#{name}.workers")
         validate_date_range(dataset["date_range"], "#{name}.date_range")
+        validate_partition_key(dataset["partition_key"],
+                               "#{name}.partition_key")
 
         validate_parameter_type(Hash, dataset["ring"], "#{name}.ring")
         dataset["ring"].each do |key, value|
@@ -304,6 +306,11 @@ module Droonga
         return if value == "infinity"
       end
 
+      def validate_partition_key(value, name)
+        validate_parameter_type(String, value, "name")
+        return if value == "_key"
+      end
+
       def validate_ring(ring, name)
         validate_parameter_type(Hash, ring, name)
 
-------------- next part --------------
HTML����������������������������...
Download 



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