[Groonga-commit] droonga/fluent-plugin-droonga at 3bdf610 [master] schema: Add schema for watch as a practical config

Back to archive index

Yoji Shidara null+****@clear*****
Tue Feb 18 17:29:43 JST 2014


Yoji Shidara	2014-02-18 17:29:43 +0900 (Tue, 18 Feb 2014)

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

  Message:
    schema: Add schema for watch as a practical config

  Modified files:
    test/unit/catalog/test_schema.rb

  Modified: test/unit/catalog/test_schema.rb (+98 -0)
===================================================================
--- test/unit/catalog/test_schema.rb    2014-02-18 17:11:50 +0900 (b19b528)
+++ test/unit/catalog/test_schema.rb    2014-02-18 17:29:43 +0900 (32ddbf7)
@@ -72,6 +72,104 @@ class CatalogSchemaTest < Test::Unit::TestCase
       )
     end
 
+    def test_integration
+      assert_equal([
+                     {
+                       "type" => "table_create",
+                       "body" => {
+                         "name"       => "Keyword",
+                         "key_type"   => "ShortText",
+                         "flags"      => "TABLE_PAT_KEY",
+                         "normalizer" => "NormalizerAuto",
+                       }
+                     },
+                     {
+                       "type" => "table_create",
+                       "body" => {
+                         "name"     => "Query",
+                         "key_type" => "ShortText",
+                         "flags"    => "TABLE_HASH_KEY"
+                       }
+                     },
+                     {
+                       "type" => "table_create",
+                       "body" => {
+                         "name"     => "Route",
+                         "key_type" => "ShortText",
+                         "flags"    => "TABLE_HASH_KEY"
+                       }
+                     },
+                     {
+                       "type" => "table_create",
+                       "body" => {
+                         "name"     => "Subscriber",
+                         "key_type" => "ShortText",
+                         "flags"    => "TABLE_HASH_KEY"
+                       }
+                     }
+                     # TODO add column_create commands
+                   ],
+                   create_schema(
+                     "Keyword" => {
+                       "type"       => "PatriciaTrie",
+                       "keyType"    => "ShortText",
+                       "normalizer" => "NormalizerAuto",
+                       "columns" => {
+                         "queries" => {
+                           "type"      => "Index",
+                           "valueType" => "Query",
+                           "indexOptions" => {
+                             "sources" => [
+                               "keywords"
+                             ]
+                           }
+                         },
+                       }
+                     },
+                     "Query" => {
+                       "type"    => "Hash",
+                       "keyType" => "ShortText",
+                       "columns" => {
+                         "subscribers" => {
+                           "type"      => "Index",
+                           "valueType" => "Subscriber",
+                           "indexOptions" => {
+                             "sources" => [
+                               "subscriptions"
+                             ]
+                           }
+                         },
+                         "keywords" => {
+                           "type"      => "Vector",
+                           "valueType" => "Keyword"
+                         }
+                       }
+                     },
+                     "Route" => {
+                       "type"    => "Hash",
+                       "keyType" => "ShortText"
+                     },
+                     "Subscriber" => {
+                       "type"    => "Hash",
+                       "keyType" => "ShortText",
+                       "columns" => {
+                         "last_modified" => {
+                           "type"      => "Scalar",
+                           "valueType" => "Time"
+                         },
+                         "subscriptions" => {
+                           "type"      => "Vector",
+                           "valueType" => "Query"
+                         },
+                         "route" => {
+                           "type"      => "Scalar",
+                           "valueType" => "Route"
+                         },
+                       }
+                     }
+                   ).to_commands)
+    end
+
     class TableTest < self
       def create_table(name, data)
         Droonga::Catalog::Schema::Table.new(name, data)
-------------- next part --------------
HTML����������������������������...
Download 



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