[Groonga-commit] groonga/groonga at 2bf4cfb [master] logical_count: add logical_table existence check

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Feb 3 11:43:07 JST 2015


Kouhei Sutou	2015-02-03 11:43:07 +0900 (Tue, 03 Feb 2015)

  New Revision: 2bf4cfbe9b6177377fcc0be7566784389ac7fd5e
  https://github.com/groonga/groonga/commit/2bf4cfbe9b6177377fcc0be7566784389ac7fd5e

  Message:
    logical_count: add logical_table existence check

  Added files:
    plugins/sharding/search.rb
    test/command/suite/sharding/logical_count/no_logical_table.expected
    test/command/suite/sharding/logical_count/no_logical_table.test

  Added: plugins/sharding/search.rb (+24 -0) 100644
===================================================================
--- /dev/null
+++ plugins/sharding/search.rb    2015-02-03 11:43:07 +0900 (9ac89b7)
@@ -0,0 +1,24 @@
+module Groonga
+  module Sharding
+    class LogicalCountCommand < Command
+      register("logical_count",
+               [
+                 "logical_table",
+                 "shared_key",
+                 "min",
+                 "min_border",
+                 "max",
+                 "max_border",
+                 "filter",
+               ])
+
+      def run_body(input)
+        logical_table = input[:logical_table]
+        if logical_table.nil?
+          raise InvalidArgument, "[logical_count] logical_table is missing"
+        end
+        output(0)
+      end
+    end
+  end
+end

  Added: test/command/suite/sharding/logical_count/no_logical_table.expected (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_logical_table.expected    2015-02-03 11:43:07 +0900 (28c2642)
@@ -0,0 +1,4 @@
+register sharding/search
+[[0,0.0,0.0],true]
+logical_count
+[[[-22,0.0,0.0],"[logical_count] logical_table is missing"]]

  Added: test/command/suite/sharding/logical_count/no_logical_table.test (+5 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_count/no_logical_table.test    2015-02-03 11:43:07 +0900 (544d1ec)
@@ -0,0 +1,5 @@
+#@on-error omit
+register sharding/search
+#@on-error default
+
+logical_count
-------------- next part --------------
HTML����������������������������...
Descargar 



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