[Groonga-commit] droonga/fluent-plugin-droonga at d1f4913 [master] Validate number_of_replicas

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 12 14:14:32 JST 2014


YUKI Hiroshi	2014-02-12 14:14:32 +0900 (Wed, 12 Feb 2014)

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

  Message:
    Validate number_of_replicas

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

  Modified: lib/droonga/catalog/base.rb (+8 -0)
===================================================================
--- lib/droonga/catalog/base.rb    2014-02-12 14:12:35 +0900 (fb33b5f)
+++ lib/droonga/catalog/base.rb    2014-02-12 14:14:32 +0900 (71dbd66)
@@ -208,6 +208,14 @@ module Droonga
           raise SmallerThanOne.new("#{name}.number_of_partitions", n_partitions, @path)
         end
 
+        n_replicas = dataset["number_of_replicas"]
+        validate_parameter_type(n_replicas,
+                                "#{name}.number_of_replicas",
+                                Integer)
+        if n_replicas < 1
+          raise SmallerThanOne.new("#{name}.number_of_replicas", n_replicas, @path)
+        end
+
         validate_parameter_type(dataset["ring"],
                                 "#{name}.ring",
                                 Hash)
-------------- next part --------------
HTML����������������������������...
Download 



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