bigrecord 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +44 -0
  3. data/Rakefile +17 -0
  4. data/VERSION +1 -0
  5. data/doc/bigrecord_specs.rdoc +36 -0
  6. data/doc/getting_started.rdoc +157 -0
  7. data/examples/bigrecord.yml +25 -0
  8. data/generators/bigrecord/bigrecord_generator.rb +17 -0
  9. data/generators/bigrecord/templates/bigrecord.rake +47 -0
  10. data/generators/bigrecord_migration/bigrecord_migration_generator.rb +13 -0
  11. data/generators/bigrecord_migration/templates/migration.rb +9 -0
  12. data/generators/bigrecord_model/bigrecord_model_generator.rb +28 -0
  13. data/generators/bigrecord_model/templates/migration.rb +13 -0
  14. data/generators/bigrecord_model/templates/model.rb +7 -0
  15. data/generators/bigrecord_model/templates/model_spec.rb +12 -0
  16. data/init.rb +9 -0
  17. data/install.rb +22 -0
  18. data/lib/big_record/abstract_base.rb +1088 -0
  19. data/lib/big_record/action_view_extensions.rb +266 -0
  20. data/lib/big_record/ar_associations/association_collection.rb +194 -0
  21. data/lib/big_record/ar_associations/association_proxy.rb +158 -0
  22. data/lib/big_record/ar_associations/belongs_to_association.rb +57 -0
  23. data/lib/big_record/ar_associations/belongs_to_many_association.rb +57 -0
  24. data/lib/big_record/ar_associations/has_and_belongs_to_many_association.rb +164 -0
  25. data/lib/big_record/ar_associations/has_many_association.rb +191 -0
  26. data/lib/big_record/ar_associations/has_one_association.rb +80 -0
  27. data/lib/big_record/ar_associations.rb +1608 -0
  28. data/lib/big_record/ar_reflection.rb +223 -0
  29. data/lib/big_record/attribute_methods.rb +75 -0
  30. data/lib/big_record/base.rb +618 -0
  31. data/lib/big_record/br_associations/association_collection.rb +194 -0
  32. data/lib/big_record/br_associations/association_proxy.rb +153 -0
  33. data/lib/big_record/br_associations/belongs_to_association.rb +52 -0
  34. data/lib/big_record/br_associations/belongs_to_many_association.rb +293 -0
  35. data/lib/big_record/br_associations/cached_item_proxy.rb +194 -0
  36. data/lib/big_record/br_associations/cached_item_proxy_factory.rb +62 -0
  37. data/lib/big_record/br_associations/has_and_belongs_to_many_association.rb +168 -0
  38. data/lib/big_record/br_associations/has_one_association.rb +80 -0
  39. data/lib/big_record/br_associations.rb +978 -0
  40. data/lib/big_record/br_reflection.rb +151 -0
  41. data/lib/big_record/callbacks.rb +367 -0
  42. data/lib/big_record/connection_adapters/abstract/connection_specification.rb +279 -0
  43. data/lib/big_record/connection_adapters/abstract/database_statements.rb +175 -0
  44. data/lib/big_record/connection_adapters/abstract/quoting.rb +58 -0
  45. data/lib/big_record/connection_adapters/abstract_adapter.rb +190 -0
  46. data/lib/big_record/connection_adapters/column.rb +491 -0
  47. data/lib/big_record/connection_adapters/hbase_adapter.rb +432 -0
  48. data/lib/big_record/connection_adapters/view.rb +27 -0
  49. data/lib/big_record/connection_adapters.rb +10 -0
  50. data/lib/big_record/deletion.rb +73 -0
  51. data/lib/big_record/dynamic_schema.rb +92 -0
  52. data/lib/big_record/embedded.rb +71 -0
  53. data/lib/big_record/embedded_associations/association_proxy.rb +148 -0
  54. data/lib/big_record/family_span_columns.rb +89 -0
  55. data/lib/big_record/fixtures.rb +1025 -0
  56. data/lib/big_record/migration.rb +380 -0
  57. data/lib/big_record/routing_ext.rb +65 -0
  58. data/lib/big_record/timestamp.rb +51 -0
  59. data/lib/big_record/validations.rb +830 -0
  60. data/lib/big_record.rb +125 -0
  61. data/lib/bigrecord.rb +1 -0
  62. data/rails/init.rb +9 -0
  63. data/spec/connections/bigrecord.yml +13 -0
  64. data/spec/connections/cassandra/connection.rb +2 -0
  65. data/spec/connections/hbase/connection.rb +2 -0
  66. data/spec/debug.log +281 -0
  67. data/spec/integration/br_associations_spec.rb +80 -0
  68. data/spec/lib/animal.rb +12 -0
  69. data/spec/lib/book.rb +10 -0
  70. data/spec/lib/broken_migrations/duplicate_name/20090706182535_add_animals_table.rb +14 -0
  71. data/spec/lib/broken_migrations/duplicate_name/20090706193019_add_animals_table.rb +9 -0
  72. data/spec/lib/broken_migrations/duplicate_version/20090706190623_add_books_table.rb +9 -0
  73. data/spec/lib/broken_migrations/duplicate_version/20090706190623_add_companies_table.rb +9 -0
  74. data/spec/lib/company.rb +14 -0
  75. data/spec/lib/embedded/web_link.rb +12 -0
  76. data/spec/lib/employee.rb +33 -0
  77. data/spec/lib/migrations/20090706182535_add_animals_table.rb +13 -0
  78. data/spec/lib/migrations/20090706190623_add_books_table.rb +15 -0
  79. data/spec/lib/migrations/20090706193019_add_companies_table.rb +14 -0
  80. data/spec/lib/migrations/20090706194512_add_employees_table.rb +13 -0
  81. data/spec/lib/migrations/20090706195741_add_zoos_table.rb +13 -0
  82. data/spec/lib/novel.rb +5 -0
  83. data/spec/lib/zoo.rb +17 -0
  84. data/spec/spec.opts +4 -0
  85. data/spec/spec_helper.rb +55 -0
  86. data/spec/unit/abstract_base_spec.rb +287 -0
  87. data/spec/unit/adapters/abstract_adapter_spec.rb +56 -0
  88. data/spec/unit/adapters/adapter_shared_spec.rb +51 -0
  89. data/spec/unit/adapters/hbase_adapter_spec.rb +15 -0
  90. data/spec/unit/ar_associations_spec.rb +8 -0
  91. data/spec/unit/base_spec.rb +6 -0
  92. data/spec/unit/br_associations_spec.rb +58 -0
  93. data/spec/unit/embedded_spec.rb +43 -0
  94. data/spec/unit/find_spec.rb +34 -0
  95. data/spec/unit/hash_helper_spec.rb +44 -0
  96. data/spec/unit/migration_spec.rb +144 -0
  97. data/spec/unit/model_spec.rb +315 -0
  98. data/spec/unit/validations_spec.rb +182 -0
  99. data/tasks/bigrecord_tasks.rake +47 -0
  100. data/tasks/data_store.rb +46 -0
  101. data/tasks/gem.rb +22 -0
  102. data/tasks/rdoc.rb +8 -0
  103. data/tasks/spec.rb +34 -0
  104. metadata +189 -0
data/lib/big_record.rb ADDED
@@ -0,0 +1,125 @@
1
+ #--
2
+ # Copyright (c) 2009 openplaces
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # "Software"), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #++
23
+
24
+ $:.unshift(File.dirname(__FILE__)) unless
25
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
26
+
27
+ unless defined?(ActiveSupport)
28
+ begin
29
+ $:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib")
30
+ require 'active_support'
31
+ rescue LoadError
32
+ require 'rubygems'
33
+ gem 'activesupport'
34
+ require 'active_support'
35
+ end
36
+ end
37
+
38
+ unless defined?(ActiveRecord)
39
+ begin
40
+ $:.unshift(File.dirname(__FILE__) + "/../../activerecord/lib")
41
+ require 'active_record'
42
+ rescue LoadError
43
+ require 'rubygems'
44
+ gem 'activerecord'
45
+ require 'active_record'
46
+ end
47
+ end
48
+
49
+ # FIXME: this shouldn't be required
50
+ # require 'active_record/fixtures'
51
+
52
+ require 'big_record/routing_ext'
53
+ require 'big_record/abstract_base'
54
+ require 'big_record/base'
55
+ require 'big_record/embedded'
56
+ require 'big_record/validations'
57
+ require 'big_record/callbacks'
58
+ require 'big_record/ar_reflection'
59
+ require 'big_record/br_reflection'
60
+ require 'big_record/ar_associations'
61
+ require 'big_record/br_associations'
62
+ require 'big_record/timestamp'
63
+ require 'big_record/attribute_methods'
64
+ require 'big_record/embedded_associations/association_proxy'
65
+ require 'big_record/dynamic_schema'
66
+ require 'big_record/deletion'
67
+ require 'big_record/family_span_columns'
68
+ require 'big_record/migration'
69
+ require 'big_record/connection_adapters'
70
+ require 'big_record/fixtures'
71
+
72
+ # Add support for collections to tag builders
73
+ require 'big_record/action_view_extensions'
74
+
75
+ BigRecord::Base.class_eval do
76
+ include BigRecord::Validations
77
+ include BigRecord::Callbacks
78
+ include BigRecord::Timestamp
79
+ include BigRecord::ArAssociations
80
+ include BigRecord::BrAssociations
81
+ include BigRecord::ArReflection
82
+ include BigRecord::BrReflection
83
+ include BigRecord::AttributeMethods
84
+ include BigRecord::DynamicSchema
85
+ include BigRecord::Deletion
86
+ include BigRecord::FamilySpanColumns
87
+ end
88
+
89
+ BigRecord::Embedded.class_eval do
90
+ include BigRecord::Validations
91
+ include BigRecord::Callbacks
92
+ include BigRecord::Timestamp
93
+ include BigRecord::ArAssociations
94
+ include BigRecord::BrAssociations
95
+ include BigRecord::ArReflection
96
+ include BigRecord::BrReflection
97
+ include BigRecord::AttributeMethods
98
+ include BigRecord::DynamicSchema
99
+ end
100
+
101
+ # Mixin the BigRecord associations with ActiveRecord
102
+ ActiveRecord::Base.class_eval do
103
+ include BigRecord::BrAssociations
104
+ include BigRecord::BrReflection
105
+ end
106
+
107
+ # Patch to call the validation of the embedded objects to HbaseRecord::Base instances.
108
+ BigRecord::Base.class_eval do
109
+ validate :validate_embeddeds
110
+
111
+ def validate_embeddeds
112
+ attributes.each do |k, v|
113
+ if v.kind_of?(BigRecord::Embedded)
114
+ errors.add(k, "is invalid: @errors=#{v.errors.full_messages.inspect}") unless v.valid?
115
+ elsif v.is_a?(Array) and v.first.kind_of?(BigRecord::Embedded)
116
+ v.each_with_index do |item, i|
117
+ next if item.blank?
118
+ unless item.valid?
119
+ errors.add(k, "is invalid. The item ##{i} in the collection has the following errors: @errors=#{item.errors.full_messages.inspect}")
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
data/lib/bigrecord.rb ADDED
@@ -0,0 +1 @@
1
+ require 'big_record'
data/rails/init.rb ADDED
@@ -0,0 +1,9 @@
1
+ require 'big_record'
2
+
3
+ # Use the same logger as ActiveRecord to make sure that the access to the log file is properly handled
4
+ BigRecord::Base.logger = ActiveRecord::Base.logger
5
+ BigRecord::Embedded.logger = ActiveRecord::Base.logger
6
+
7
+ # Establish the connection with the database
8
+ BigRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/bigrecord.yml"))
9
+ BigRecord::Base.establish_connection
@@ -0,0 +1,13 @@
1
+ hbase:
2
+ adapter: hbase
3
+ zookeeper_quorum: localhost
4
+ zookeeper_client_port: 21811
5
+ drb_host: localhost
6
+ drb_port: 50001
7
+
8
+ cassandra:
9
+ adapter: cassandra
10
+ address: localhost
11
+ port: 9160
12
+ drb_host: localhost
13
+ drb_port: 50002
@@ -0,0 +1,2 @@
1
+ BigRecord::Base.logger.info "Connecting to Cassandra data store (#{BigRecord::Base.configurations.inspect})"
2
+ BigRecord::Base.establish_connection 'cassandra'
@@ -0,0 +1,2 @@
1
+ BigRecord::Base.logger.info "Connecting to Hbase data store (#{BigRecord::Base.configurations.inspect})"
2
+ BigRecord::Base.establish_connection 'hbase'
data/spec/debug.log ADDED
@@ -0,0 +1,281 @@
1
+ # Logfile created on Tue Sep 29 18:00:46 -0400 2009 by /
2
+ Connecting to Hbase data store ({"hbase"=>{"drb_host"=>"localhost", "zookeeper_quorum"=>"localhost", "drb_port"=>50001, "zookeeper_client_port"=>21811, "adapter"=>"hbase"}, "cassandra"=>{"address"=>"localhost", "drb_host"=>"localhost", "drb_port"=>50002, "port"=>9160, "adapter"=>"cassandra"}})
3
+ HBASE (0.000000) BigRecordDriver::TableNotFound: animals: SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
4
+ HBASE (0.000000) BigRecordDriver::TableNotFound: animals: SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
5
+ HBASE (0.000000) BigRecordDriver::TableNotFound: animals: SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
6
+ HBASE (0.000000) BigRecordDriver::TableNotFound: animals: SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
7
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
8
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
9
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
10
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
11
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
12
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
13
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
14
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
15
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
16
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
17
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
18
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
19
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
20
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
21
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
22
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
23
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
24
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
25
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
26
+ HBASE (0.000000) BigRecordDriver::TableNotFound: zoos: SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
27
+ WARNING: Can't mass-assign these protected attributes: employees
28
+ WARNING: Can't mass-assign these protected attributes: employees
29
+ WARNING: Can't mass-assign these protected attributes: readonly, employees
30
+ WARNING: Can't mass-assign these protected attributes: employees
31
+ WARNING: Can't mass-assign these protected attributes: name
32
+ Migrating to AddAnimalsTable (20090706182535)
33
+ Migrating to AddBooksTable (20090706190623)
34
+ Migrating to AddCompaniesTable (20090706193019)
35
+ Migrating to AddEmployeesTable (20090706194512)
36
+ Migrating to AddZoosTable (20090706195741)
37
+ Migrating to AddAnimalsTable (20090706182535)
38
+ Migrating to AddAnimalsTable (20090706182535)
39
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
40
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
41
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
42
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
43
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
44
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
45
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
46
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
47
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
48
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
49
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
50
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
51
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
52
+ HBASE (0.000000) BigRecordDriver::TableNotFound: books: SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
53
+ HBASE (0.000000) BigRecordDriver::TableNotFound: animals: SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
54
+ Connecting to Hbase data store ({"hbase"=>{"drb_host"=>"localhost", "zookeeper_quorum"=>"localhost", "drb_port"=>50001, "zookeeper_client_port"=>21811, "adapter"=>"hbase"}, "cassandra"=>{"address"=>"localhost", "drb_host"=>"localhost", "drb_port"=>50002, "port"=>9160, "adapter"=>"cassandra"}})
55
+ HBASE (0.022437) SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
56
+ HBASE (0.015733) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
57
+ HBASE (0.011078) UPDATE zoos SET {"attr:name"=>"\001Some Zoo", "attr:address"=>"\001123 Address St.", "attr:readonly"=>"\000", "attr:employees"=>"\000", "attr:weblink"=>"\000", "attr:description"=>"\001This is Some Zoo located at 123 Address St.", "attr:animal_ids"=>"--- []\n\n"} WHERE ROW=7bc03680-eb56-45d1-8dbc-323defb4643c;
58
+ HBASE (0.011281) UPDATE animals SET {"attribute:zoo_id"=>"\0017bc03680-eb56-45d1-8dbc-323defb4643c", "attribute:book_ids"=>"--- []\n\n", "attribute:type"=>"--- 0\n", "attribute:description"=>"\000", "attribute:name"=>"\001Stampy"} WHERE ROW=d794aa3c-bfbe-46a3-b98a-934a36840ee0;
59
+ HBASE (0.023628) SELECT (attribute:zoo_id, attribute:book_ids, attribute:type, attribute:description, attribute:name) FROM animals WHERE ROW=d794aa3c-bfbe-46a3-b98a-934a36840ee0;
60
+ HBASE (0.007771) SELECT (attribute:zoo_id, attribute:book_ids, attribute:type, attribute:description, attribute:name) FROM animals WHERE ROW=d794aa3c-bfbe-46a3-b98a-934a36840ee0;
61
+ HBASE (0.009221) SELECT (attr:name, attr:address, attr:readonly, attr:employees, attr:weblink, attr:description, attr:animal_ids) FROM zoos WHERE ROW=7bc03680-eb56-45d1-8dbc-323defb4643c;
62
+ HBASE (0.010026) SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
63
+ HBASE (0.007432) DELETE FROM animals WHERE ROW=d794aa3c-bfbe-46a3-b98a-934a36840ee0;
64
+ HBASE (0.009833) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
65
+ HBASE (0.003909) DELETE FROM zoos WHERE ROW=7bc03680-eb56-45d1-8dbc-323defb4643c;
66
+ HBASE (0.010187) SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
67
+ HBASE (0.010737) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
68
+ HBASE (0.016145) UPDATE zoos SET {"attr:name"=>"\001Some Zoo", "attr:address"=>"\001123 Address St.", "attr:readonly"=>"\000", "attr:employees"=>"\000", "attr:weblink"=>"\000", "attr:description"=>"\001This is Some Zoo located at 123 Address St.", "attr:animal_ids"=>"--- []\n\n"} WHERE ROW=63331fd8-34d1-4e58-8af4-16bae7ee3e11;
69
+ HBASE (0.008209) UPDATE animals SET {"attribute:zoo_id"=>"\00163331fd8-34d1-4e58-8af4-16bae7ee3e11", "attribute:book_ids"=>"--- []\n\n", "attribute:type"=>"--- 0\n", "attribute:description"=>"\000", "attribute:name"=>"\001Stampy"} WHERE ROW=f14d136d-bf04-4734-a492-9dfc13d82e74;
70
+ HBASE (0.010670) UPDATE animals SET {"attribute:zoo_id"=>"\00163331fd8-34d1-4e58-8af4-16bae7ee3e11", "attribute:book_ids"=>"--- []\n\n", "attribute:type"=>"--- 0\n", "attribute:description"=>"\000", "attribute:name"=>"\001Dumbo"} WHERE ROW=60a6525f-d9f5-45d5-831d-9f7a53687a82;
71
+ HBASE (0.011815) UPDATE zoos SET {"attr:name"=>"\001Some Zoo", "attr:address"=>"\001123 Address St.", "attr:readonly"=>"\000", "attr:employees"=>"\000", "attr:weblink"=>"\000", "attr:description"=>"\001This is Some Zoo located at 123 Address St.", "attr:animal_ids"=>"--- \n- f14d136d-bf04-4734-a492-9dfc13d82e74\n- 60a6525f-d9f5-45d5-831d-9f7a53687a82\n"} WHERE ROW=63331fd8-34d1-4e58-8af4-16bae7ee3e11;
72
+ HBASE (0.007880) SELECT (attr:name, attr:address, attr:readonly, attr:employees, attr:weblink, attr:description, attr:animal_ids) FROM zoos WHERE ROW=63331fd8-34d1-4e58-8af4-16bae7ee3e11;
73
+ HBASE (0.007931) SELECT (attr:name, attr:address, attr:readonly, attr:employees, attr:weblink, attr:description, attr:animal_ids) FROM zoos WHERE ROW=63331fd8-34d1-4e58-8af4-16bae7ee3e11;
74
+ HBASE (0.006733) SELECT (attribute:zoo_id, attribute:book_ids, attribute:type, attribute:description, attribute:name) FROM animals WHERE ROW=f14d136d-bf04-4734-a492-9dfc13d82e74;
75
+ HBASE (0.008996) SELECT (attribute:zoo_id, attribute:book_ids, attribute:type, attribute:description, attribute:name) FROM animals WHERE ROW=60a6525f-d9f5-45d5-831d-9f7a53687a82;
76
+ HBASE (0.012351) SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
77
+ HBASE (0.003899) DELETE FROM animals WHERE ROW=60a6525f-d9f5-45d5-831d-9f7a53687a82;
78
+ HBASE (0.003673) DELETE FROM animals WHERE ROW=f14d136d-bf04-4734-a492-9dfc13d82e74;
79
+ HBASE (0.020741) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
80
+ HBASE (0.004033) DELETE FROM zoos WHERE ROW=63331fd8-34d1-4e58-8af4-16bae7ee3e11;
81
+ HBASE (0.005796) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
82
+ HBASE (0.006377) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
83
+ HBASE (0.005561) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
84
+ HBASE (0.005976) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
85
+ HBASE (0.005514) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
86
+ HBASE (0.005864) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
87
+ HBASE (0.006374) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
88
+ HBASE (0.005958) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
89
+ HBASE (0.005807) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
90
+ HBASE (0.005574) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
91
+ HBASE (0.005405) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
92
+ WARNING: Can't mass-assign these protected attributes: employees
93
+ WARNING: Can't mass-assign these protected attributes: employees
94
+ HBASE (0.006028) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
95
+ HBASE (0.005590) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
96
+ WARNING: Can't mass-assign these protected attributes: readonly, employees
97
+ WARNING: Can't mass-assign these protected attributes: employees
98
+ HBASE (0.005735) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
99
+ HBASE (0.005762) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
100
+ HBASE (0.005543) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
101
+ HBASE (0.005354) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
102
+ WARNING: Can't mass-assign these protected attributes: name
103
+ HBASE (0.006637) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
104
+ HBASE (0.006119) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
105
+ HBASE (0.009624) UPDATE zoos SET {"attr:name"=>"\001African Lion Safari", "attr:address"=>"\001RR #1 Cambridge, Ontario Canada\nN1R 5S2", "attr:readonly"=>"\000", "attr:employees"=>"\000", "attr:weblink"=>"--- \ntitle: African Lion Safari - Wikipedia\nurl: http://en.wikipedia.org/wiki/African_Lion_Safari\nid: 03ae3c11-14f1-4f13-a7fd-9427ef795b62\n", "attr:description"=>"\001Canada's Original Safari Adventure", "attr:animal_ids"=>"--- []\n\n"} WHERE ROW=fcf8845f-09ce-468e-b968-d657729ef384;
106
+ HBASE (0.007397) SELECT (attr:name, attr:address, attr:readonly, attr:employees, attr:weblink, attr:description, attr:animal_ids) FROM zoos WHERE ROW=fcf8845f-09ce-468e-b968-d657729ef384;
107
+ HBASE (0.009729) UPDATE zoos SET {"attr:name"=>"\001African Lion Safari", "attr:address"=>"\001RR #1 Cambridge, Ontario Canada\nN1R 5S2", "attr:readonly"=>"\000", "attr:employees"=>"\000", "attr:weblink"=>"--- \ntitle: African Lion Safari\nurl: http://www.lionsafari.com/\nid: 13a84f24-9043-4880-8d75-50d4cae3e34b\n", "attr:description"=>"\001Canada's Original Safari Adventure", "attr:animal_ids"=>"--- []\n\n"} WHERE ROW=fcf8845f-09ce-468e-b968-d657729ef384;
108
+ HBASE (0.007782) SELECT (attr:name, attr:address, attr:readonly, attr:employees, attr:weblink, attr:description, attr:animal_ids) FROM zoos WHERE ROW=fcf8845f-09ce-468e-b968-d657729ef384;
109
+ HBASE (0.014803) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
110
+ HBASE (0.003899) DELETE FROM zoos WHERE ROW=fcf8845f-09ce-468e-b968-d657729ef384;
111
+ WARNING: Can't mass-assign these protected attributes: employees
112
+ WARNING: Can't mass-assign these protected attributes: employees
113
+ WARNING: Can't mass-assign these protected attributes: readonly, employees
114
+ WARNING: Can't mass-assign these protected attributes: employees
115
+ WARNING: Can't mass-assign these protected attributes: name
116
+ Migrating to AddAnimalsTable (20090706182535)
117
+ Migrating to AddBooksTable (20090706190623)
118
+ Migrating to AddCompaniesTable (20090706193019)
119
+ Migrating to AddEmployeesTable (20090706194512)
120
+ Migrating to AddZoosTable (20090706195741)
121
+ Migrating to AddAnimalsTable (20090706182535)
122
+ Migrating to AddAnimalsTable (20090706182535)
123
+ HBASE (0.015288) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
124
+ HBASE (0.005271) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
125
+ HBASE (0.005154) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
126
+ HBASE (0.007712) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\000", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=aa91cf66-f52f-4164-b7e0-4bc09a916b5a;
127
+ HBASE (0.007866) SELECT (family2:, log:change, attribute:description, attribute:title, attribute:author, attribute:links) FROM books WHERE ROW=aa91cf66-f52f-4164-b7e0-4bc09a916b5a;
128
+ HBASE (0.008086) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
129
+ HBASE (0.003779) DELETE FROM books WHERE ROW=aa91cf66-f52f-4164-b7e0-4bc09a916b5a;
130
+ HBASE (0.005770) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
131
+ HBASE (0.007684) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=16afcbfb-3417-49c2-9455-e6f97a08139c;
132
+ HBASE (0.008154) SELECT (family2:, log:change, attribute:description, attribute:title, attribute:author, attribute:links) FROM books WHERE ROW=16afcbfb-3417-49c2-9455-e6f97a08139c;
133
+ HBASE (0.007918) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
134
+ HBASE (0.003649) DELETE FROM books WHERE ROW=16afcbfb-3417-49c2-9455-e6f97a08139c;
135
+ HBASE (0.005293) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
136
+ HBASE (0.008548) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=c121b605-32f6-452f-9d22-dcc9a4958296;
137
+ HBASE (0.006478) SELECT (family2:, log:change, attribute:description, attribute:title, attribute:author, attribute:links) FROM books WHERE ROW=c121b605-32f6-452f-9d22-dcc9a4958296;
138
+ HBASE (0.007619) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001One of the Ten All-Time Best Novels of Vampirism.", "attribute:title"=>"\001I Am Legend", "attribute:links"=>"--- []\n\n", "attribute:author"=>"\001Richard Matheson"} WHERE ROW=c121b605-32f6-452f-9d22-dcc9a4958296;
139
+ HBASE (0.006651) SELECT (family2:, log:change, attribute:description, attribute:title, attribute:author, attribute:links) FROM books WHERE ROW=c121b605-32f6-452f-9d22-dcc9a4958296;
140
+ HBASE (0.018217) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
141
+ HBASE (0.004036) DELETE FROM books WHERE ROW=c121b605-32f6-452f-9d22-dcc9a4958296;
142
+ HBASE (0.005359) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
143
+ HBASE (0.005672) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
144
+ HBASE (0.005687) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
145
+ HBASE (0.009068) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=da2cbdbd-e942-424c-9cfc-6ea0b582d67e;
146
+ HBASE (0.007694) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=eb4073f6-c70b-4d90-bb0e-7f34a33cab38;
147
+ HBASE (0.009990) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001One of the Ten All-Time Best Novels of Vampirism.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=eb4073f6-c70b-4d90-bb0e-7f34a33cab38;
148
+ HBASE (0.007348) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=d6825c0e-45e8-4a67-9c4c-9e2e26cdec8d;
149
+ HBASE (0.013432) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
150
+ HBASE (0.003984) DELETE FROM books WHERE ROW=d6825c0e-45e8-4a67-9c4c-9e2e26cdec8d;
151
+ HBASE (0.005141) DELETE FROM books WHERE ROW=da2cbdbd-e942-424c-9cfc-6ea0b582d67e;
152
+ HBASE (0.007643) DELETE FROM books WHERE ROW=eb4073f6-c70b-4d90-bb0e-7f34a33cab38;
153
+ HBASE (0.007417) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
154
+ HBASE (0.008011) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=564b6a87-cc10-4c38-9f61-dadabde79365;
155
+ HBASE (0.008051) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001One of the most important writers of the twentieth century.", "attribute:title"=>"\001A Stir of Echoes", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=564b6a87-cc10-4c38-9f61-dadabde79365;
156
+ HBASE (0.008497) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=26329ef7-709d-4e39-a283-293a1887bbe0;
157
+ HBASE (0.008263) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=71f2cb0e-ce1b-4fe6-bec7-a88050f95cd9;
158
+ HBASE (0.008946) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001One of the most important writers of the twentieth century.", "attribute:title"=>"\001A Stir of Echoes", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=71f2cb0e-ce1b-4fe6-bec7-a88050f95cd9;
159
+ HBASE (0.011893) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=11374f45-ba58-46bc-b9c1-ea3728324184;
160
+ HBASE (0.018315) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
161
+ HBASE (0.003817) DELETE FROM books WHERE ROW=11374f45-ba58-46bc-b9c1-ea3728324184;
162
+ HBASE (0.003675) DELETE FROM books WHERE ROW=26329ef7-709d-4e39-a283-293a1887bbe0;
163
+ HBASE (0.010893) DELETE FROM books WHERE ROW=564b6a87-cc10-4c38-9f61-dadabde79365;
164
+ HBASE (0.005624) DELETE FROM books WHERE ROW=71f2cb0e-ce1b-4fe6-bec7-a88050f95cd9;
165
+ HBASE (0.006103) SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
166
+ HBASE (0.015130) SCAN (attribute:) FROM employees WHERE START_ROW= AND STOP_ROW= LIMIT=;
167
+ HBASE (0.005425) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
168
+ Connecting to Hbase data store ({"hbase"=>{"drb_host"=>"localhost", "zookeeper_quorum"=>"localhost", "drb_port"=>50001, "zookeeper_client_port"=>21811, "adapter"=>"hbase"}, "cassandra"=>{"address"=>"localhost", "drb_host"=>"localhost", "drb_port"=>50002, "port"=>9160, "adapter"=>"cassandra"}})
169
+ HBASE (0.030030) SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
170
+ HBASE (0.013632) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
171
+ HBASE (0.009042) UPDATE zoos SET {"attr:name"=>"\001Some Zoo", "attr:address"=>"\001123 Address St.", "attr:readonly"=>"\000", "attr:employees"=>"\000", "attr:weblink"=>"\000", "attr:description"=>"\001This is Some Zoo located at 123 Address St.", "attr:animal_ids"=>"--- []\n\n"} WHERE ROW=2bd53b59-305e-4b17-9d6f-bbce58a506d1;
172
+ HBASE (0.014011) UPDATE animals SET {"attribute:zoo_id"=>"\0012bd53b59-305e-4b17-9d6f-bbce58a506d1", "attribute:book_ids"=>"--- []\n\n", "attribute:type"=>"--- 0\n", "attribute:description"=>"\000", "attribute:name"=>"\001Stampy"} WHERE ROW=9ef7599a-6a65-4543-9c0c-388ffc8cb043;
173
+ HBASE (0.007069) SELECT (attribute:zoo_id, attribute:book_ids, attribute:type, attribute:description, attribute:name) FROM animals WHERE ROW=9ef7599a-6a65-4543-9c0c-388ffc8cb043;
174
+ HBASE (0.006263) SELECT (attribute:zoo_id, attribute:book_ids, attribute:type, attribute:description, attribute:name) FROM animals WHERE ROW=9ef7599a-6a65-4543-9c0c-388ffc8cb043;
175
+ HBASE (0.007377) SELECT (attr:name, attr:address, attr:readonly, attr:employees, attr:weblink, attr:description, attr:animal_ids) FROM zoos WHERE ROW=2bd53b59-305e-4b17-9d6f-bbce58a506d1;
176
+ HBASE (0.008158) SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
177
+ HBASE (0.003837) DELETE FROM animals WHERE ROW=9ef7599a-6a65-4543-9c0c-388ffc8cb043;
178
+ HBASE (0.010880) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
179
+ HBASE (0.008721) DELETE FROM zoos WHERE ROW=2bd53b59-305e-4b17-9d6f-bbce58a506d1;
180
+ HBASE (0.005679) SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
181
+ HBASE (0.005512) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
182
+ HBASE (0.009849) UPDATE zoos SET {"attr:name"=>"\001Some Zoo", "attr:address"=>"\001123 Address St.", "attr:readonly"=>"\000", "attr:employees"=>"\000", "attr:weblink"=>"\000", "attr:description"=>"\001This is Some Zoo located at 123 Address St.", "attr:animal_ids"=>"--- []\n\n"} WHERE ROW=679a6239-48aa-42a0-91d3-4f587432477e;
183
+ HBASE (0.023958) UPDATE animals SET {"attribute:zoo_id"=>"\001679a6239-48aa-42a0-91d3-4f587432477e", "attribute:book_ids"=>"--- []\n\n", "attribute:type"=>"--- 0\n", "attribute:description"=>"\000", "attribute:name"=>"\001Stampy"} WHERE ROW=27a136c9-14fd-4eb2-8ee0-9333d0ce7e8d;
184
+ HBASE (0.007794) UPDATE animals SET {"attribute:zoo_id"=>"\001679a6239-48aa-42a0-91d3-4f587432477e", "attribute:book_ids"=>"--- []\n\n", "attribute:type"=>"--- 0\n", "attribute:description"=>"\000", "attribute:name"=>"\001Dumbo"} WHERE ROW=98c1ac9e-bfef-4257-bf91-ddfff9376c4c;
185
+ HBASE (0.008970) UPDATE zoos SET {"attr:name"=>"\001Some Zoo", "attr:address"=>"\001123 Address St.", "attr:readonly"=>"\000", "attr:employees"=>"\000", "attr:weblink"=>"\000", "attr:description"=>"\001This is Some Zoo located at 123 Address St.", "attr:animal_ids"=>"--- \n- 27a136c9-14fd-4eb2-8ee0-9333d0ce7e8d\n- 98c1ac9e-bfef-4257-bf91-ddfff9376c4c\n"} WHERE ROW=679a6239-48aa-42a0-91d3-4f587432477e;
186
+ HBASE (0.006380) SELECT (attr:name, attr:address, attr:readonly, attr:employees, attr:weblink, attr:description, attr:animal_ids) FROM zoos WHERE ROW=679a6239-48aa-42a0-91d3-4f587432477e;
187
+ HBASE (0.006324) SELECT (attr:name, attr:address, attr:readonly, attr:employees, attr:weblink, attr:description, attr:animal_ids) FROM zoos WHERE ROW=679a6239-48aa-42a0-91d3-4f587432477e;
188
+ HBASE (0.005718) SELECT (attribute:zoo_id, attribute:book_ids, attribute:type, attribute:description, attribute:name) FROM animals WHERE ROW=27a136c9-14fd-4eb2-8ee0-9333d0ce7e8d;
189
+ HBASE (0.006433) SELECT (attribute:zoo_id, attribute:book_ids, attribute:type, attribute:description, attribute:name) FROM animals WHERE ROW=98c1ac9e-bfef-4257-bf91-ddfff9376c4c;
190
+ HBASE (0.011618) SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
191
+ HBASE (0.004313) DELETE FROM animals WHERE ROW=27a136c9-14fd-4eb2-8ee0-9333d0ce7e8d;
192
+ HBASE (0.003171) DELETE FROM animals WHERE ROW=98c1ac9e-bfef-4257-bf91-ddfff9376c4c;
193
+ HBASE (0.008913) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
194
+ HBASE (0.003819) DELETE FROM zoos WHERE ROW=679a6239-48aa-42a0-91d3-4f587432477e;
195
+ HBASE (0.005753) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
196
+ HBASE (0.007502) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
197
+ HBASE (0.005366) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
198
+ HBASE (0.006278) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
199
+ HBASE (0.005228) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
200
+ HBASE (0.006483) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
201
+ HBASE (0.005055) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
202
+ HBASE (0.005271) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
203
+ HBASE (0.005350) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
204
+ HBASE (0.005573) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
205
+ HBASE (0.005609) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
206
+ WARNING: Can't mass-assign these protected attributes: employees
207
+ WARNING: Can't mass-assign these protected attributes: employees
208
+ HBASE (0.005984) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
209
+ HBASE (0.005549) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
210
+ WARNING: Can't mass-assign these protected attributes: readonly, employees
211
+ WARNING: Can't mass-assign these protected attributes: employees
212
+ HBASE (0.005046) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
213
+ HBASE (0.005553) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
214
+ HBASE (0.005673) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
215
+ HBASE (0.005432) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
216
+ WARNING: Can't mass-assign these protected attributes: name
217
+ HBASE (0.005126) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
218
+ HBASE (0.006331) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
219
+ HBASE (0.009061) UPDATE zoos SET {"attr:name"=>"\001African Lion Safari", "attr:address"=>"\001RR #1 Cambridge, Ontario Canada\nN1R 5S2", "attr:readonly"=>"\000", "attr:employees"=>"\000", "attr:weblink"=>"--- \ntitle: African Lion Safari - Wikipedia\nurl: http://en.wikipedia.org/wiki/African_Lion_Safari\nid: 65c47d55-3f1e-479e-88df-59b0cc75a5a1\n", "attr:description"=>"\001Canada's Original Safari Adventure", "attr:animal_ids"=>"--- []\n\n"} WHERE ROW=22377b99-534d-429c-8314-4701f2f34a92;
220
+ HBASE (0.006500) SELECT (attr:name, attr:address, attr:readonly, attr:employees, attr:weblink, attr:description, attr:animal_ids) FROM zoos WHERE ROW=22377b99-534d-429c-8314-4701f2f34a92;
221
+ HBASE (0.008899) UPDATE zoos SET {"attr:name"=>"\001African Lion Safari", "attr:address"=>"\001RR #1 Cambridge, Ontario Canada\nN1R 5S2", "attr:readonly"=>"\000", "attr:employees"=>"\000", "attr:weblink"=>"--- \ntitle: African Lion Safari\nurl: http://www.lionsafari.com/\nid: 6db0f3d5-bd17-447d-8a4c-38f90c04b063\n", "attr:description"=>"\001Canada's Original Safari Adventure", "attr:animal_ids"=>"--- []\n\n"} WHERE ROW=22377b99-534d-429c-8314-4701f2f34a92;
222
+ HBASE (0.006449) SELECT (attr:name, attr:address, attr:readonly, attr:employees, attr:weblink, attr:description, attr:animal_ids) FROM zoos WHERE ROW=22377b99-534d-429c-8314-4701f2f34a92;
223
+ HBASE (0.008755) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
224
+ HBASE (0.003372) DELETE FROM zoos WHERE ROW=22377b99-534d-429c-8314-4701f2f34a92;
225
+ WARNING: Can't mass-assign these protected attributes: employees
226
+ WARNING: Can't mass-assign these protected attributes: employees
227
+ WARNING: Can't mass-assign these protected attributes: readonly, employees
228
+ WARNING: Can't mass-assign these protected attributes: employees
229
+ WARNING: Can't mass-assign these protected attributes: name
230
+ Migrating to AddAnimalsTable (20090706182535)
231
+ Migrating to AddBooksTable (20090706190623)
232
+ Migrating to AddCompaniesTable (20090706193019)
233
+ Migrating to AddEmployeesTable (20090706194512)
234
+ Migrating to AddZoosTable (20090706195741)
235
+ Migrating to AddAnimalsTable (20090706182535)
236
+ Migrating to AddAnimalsTable (20090706182535)
237
+ HBASE (0.016606) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
238
+ HBASE (0.006075) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
239
+ HBASE (0.008131) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
240
+ HBASE (0.008401) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\000", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=2c1b61f6-2f90-4431-a461-df1a9b1ca0ac;
241
+ HBASE (0.005559) SELECT (family2:, log:change, attribute:description, attribute:title, attribute:author, attribute:links) FROM books WHERE ROW=2c1b61f6-2f90-4431-a461-df1a9b1ca0ac;
242
+ HBASE (0.008712) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
243
+ HBASE (0.003429) DELETE FROM books WHERE ROW=2c1b61f6-2f90-4431-a461-df1a9b1ca0ac;
244
+ HBASE (0.005785) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
245
+ HBASE (0.011957) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=6dd6a743-c978-4ec3-be5c-ea7e37dad671;
246
+ HBASE (0.006368) SELECT (family2:, log:change, attribute:description, attribute:title, attribute:author, attribute:links) FROM books WHERE ROW=6dd6a743-c978-4ec3-be5c-ea7e37dad671;
247
+ HBASE (0.009124) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
248
+ HBASE (0.003870) DELETE FROM books WHERE ROW=6dd6a743-c978-4ec3-be5c-ea7e37dad671;
249
+ HBASE (0.006900) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
250
+ HBASE (0.010035) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=a1dc07a1-fcb3-4c24-b73c-1e2ba446e4cd;
251
+ HBASE (0.005799) SELECT (family2:, log:change, attribute:description, attribute:title, attribute:author, attribute:links) FROM books WHERE ROW=a1dc07a1-fcb3-4c24-b73c-1e2ba446e4cd;
252
+ HBASE (0.007686) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001One of the Ten All-Time Best Novels of Vampirism.", "attribute:title"=>"\001I Am Legend", "attribute:links"=>"--- []\n\n", "attribute:author"=>"\001Richard Matheson"} WHERE ROW=a1dc07a1-fcb3-4c24-b73c-1e2ba446e4cd;
253
+ HBASE (0.008842) SELECT (family2:, log:change, attribute:description, attribute:title, attribute:author, attribute:links) FROM books WHERE ROW=a1dc07a1-fcb3-4c24-b73c-1e2ba446e4cd;
254
+ HBASE (0.008762) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
255
+ HBASE (0.003758) DELETE FROM books WHERE ROW=a1dc07a1-fcb3-4c24-b73c-1e2ba446e4cd;
256
+ HBASE (0.006314) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
257
+ HBASE (0.008882) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
258
+ HBASE (0.012527) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
259
+ HBASE (0.007563) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=2c9923c1-d350-4ae5-825b-c5111cbdb7d2;
260
+ HBASE (0.007447) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=28f1e3b3-2241-4714-9515-55a584983c08;
261
+ HBASE (0.007191) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001One of the Ten All-Time Best Novels of Vampirism.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=28f1e3b3-2241-4714-9515-55a584983c08;
262
+ HBASE (0.013222) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=ec2a7a00-54c2-458a-a8bc-7a9bfa10adfb;
263
+ HBASE (0.013074) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
264
+ HBASE (0.014481) DELETE FROM books WHERE ROW=28f1e3b3-2241-4714-9515-55a584983c08;
265
+ HBASE (0.008979) DELETE FROM books WHERE ROW=2c9923c1-d350-4ae5-825b-c5111cbdb7d2;
266
+ HBASE (0.004048) DELETE FROM books WHERE ROW=ec2a7a00-54c2-458a-a8bc-7a9bfa10adfb;
267
+ HBASE (0.005760) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
268
+ HBASE (0.007003) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=a3b1b10f-94f9-4b3d-810e-a2bdc4e46b2a;
269
+ HBASE (0.008333) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001One of the most important writers of the twentieth century.", "attribute:title"=>"\001A Stir of Echoes", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=a3b1b10f-94f9-4b3d-810e-a2bdc4e46b2a;
270
+ HBASE (0.006893) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=6d744f0e-d385-43b5-9393-2dc825bea757;
271
+ HBASE (0.007868) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=a4aefb46-d6e3-48aa-90df-eb86e7f83328;
272
+ HBASE (0.006942) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001One of the most important writers of the twentieth century.", "attribute:title"=>"\001A Stir of Echoes", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=a4aefb46-d6e3-48aa-90df-eb86e7f83328;
273
+ HBASE (0.007229) UPDATE books SET {"log:change"=>"--- []\n\n", "attribute:description"=>"\001The most clever and riveting vampire novel since Dracula.", "attribute:title"=>"\001I Am Legend", "attribute:author"=>"\001Richard Matheson", "attribute:links"=>"--- []\n\n"} WHERE ROW=246c5178-b106-4e35-b374-0970ab850109;
274
+ HBASE (0.016829) SCAN (attribute:) FROM books WHERE START_ROW= AND STOP_ROW= LIMIT=;
275
+ HBASE (0.007399) DELETE FROM books WHERE ROW=246c5178-b106-4e35-b374-0970ab850109;
276
+ HBASE (0.003247) DELETE FROM books WHERE ROW=6d744f0e-d385-43b5-9393-2dc825bea757;
277
+ HBASE (0.003510) DELETE FROM books WHERE ROW=a3b1b10f-94f9-4b3d-810e-a2bdc4e46b2a;
278
+ HBASE (0.003222) DELETE FROM books WHERE ROW=a4aefb46-d6e3-48aa-90df-eb86e7f83328;
279
+ HBASE (0.005776) SCAN (attribute:) FROM animals WHERE START_ROW= AND STOP_ROW= LIMIT=;
280
+ HBASE (0.015407) SCAN (attribute:) FROM employees WHERE START_ROW= AND STOP_ROW= LIMIT=;
281
+ HBASE (0.005031) SCAN (attr:) FROM zoos WHERE START_ROW= AND STOP_ROW= LIMIT=;
@@ -0,0 +1,80 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
2
+
3
+ describe BigRecord::BrAssociations do
4
+
5
+ # Clear the tables before and after these tests
6
+ before(:each) do
7
+ Animal.delete_all
8
+ Zoo.delete_all
9
+ end
10
+
11
+ after(:each) do
12
+ Animal.delete_all
13
+ Zoo.delete_all
14
+ end
15
+
16
+ describe " #belongs_to" do
17
+
18
+ it "should reference the appropriate model" do
19
+ # Creating the zoo
20
+ zoo_attributes = {:name => "Some Zoo",
21
+ :address => "123 Address St.",
22
+ :description => "This is Some Zoo located at 123 Address St."}
23
+ zoo = Zoo.new(zoo_attributes)
24
+ zoo.save.should be_true
25
+
26
+ # Creating the animal
27
+ animal = Animal.new(:name => "Stampy", :type => "Elephant")
28
+ animal.zoo = zoo
29
+ animal.save.should be_true
30
+
31
+ # Now checking the association
32
+ saved_animal = Animal.find(animal.id)
33
+ saved_animal.reload # ensure that it's not cached
34
+ saved_animal.zoo.should be_a_kind_of(Zoo)
35
+ saved_animal.zoo.new_record?.should be_false
36
+ saved_animal.zoo.name.should == zoo_attributes[:name]
37
+ saved_animal.zoo.address.should == zoo_attributes[:address]
38
+ saved_animal.zoo.description.should == zoo_attributes[:description]
39
+ end
40
+
41
+ end
42
+
43
+ describe " #belongs_to_many" do
44
+
45
+ it "should reference the appropriate list of models" do
46
+ # Creating the zoo
47
+ zoo_attributes = {:name => "Some Zoo",
48
+ :address => "123 Address St.",
49
+ :description => "This is Some Zoo located at 123 Address St."}
50
+ zoo = Zoo.new(zoo_attributes)
51
+ zoo.save.should be_true
52
+
53
+ # Creating the animals
54
+ animal1 = Animal.new(:name => "Stampy", :type => "Elephant")
55
+ animal1.zoo = zoo
56
+ animal1.save.should be_true
57
+
58
+ animal2 = Animal.new(:name => "Dumbo", :type => "Elephant")
59
+ animal2.zoo = zoo
60
+ animal2.save.should be_true
61
+
62
+ # Associating the animals to the zoo
63
+ zoo.animals << animal1
64
+ zoo.animals << animal2
65
+ zoo.save.should be_true
66
+
67
+ # Now we'll retrieve the Zoo record and check the association
68
+ saved_zoo = Zoo.find(zoo.id)
69
+ saved_zoo.reload
70
+ saved_zoo.animals.should be_a_kind_of(Array)
71
+
72
+ saved_zoo["attr:animal_ids"].should == saved_zoo.animal_ids
73
+ saved_zoo.animal_ids.should include(animal1.id)
74
+ saved_zoo.animal_ids.should include(animal2.id)
75
+ saved_zoo.animals.each{|animal| animal.should be_a_kind_of(Animal)}
76
+ end
77
+
78
+ end
79
+
80
+ end
@@ -0,0 +1,12 @@
1
+ class Animal < BigRecord::Base
2
+
3
+ column 'attribute:name', 'string'
4
+ column 'attribute:type', 'integer'
5
+ column :description, :string
6
+
7
+ column 'attribute:zoo_id', 'string'
8
+ column 'attribute:book_ids', 'string', :collection => true
9
+
10
+ belongs_to_big_record :zoo, :foreign_key => 'attribute:zoo_id'
11
+ belongs_to_many :books, :foreign_key => 'attribute:book_ids'
12
+ end
data/spec/lib/book.rb ADDED
@@ -0,0 +1,10 @@
1
+ class Book < BigRecord::Base
2
+ column 'attribute:title', 'string'
3
+ column 'attribute:author', 'string'
4
+ column 'attribute:description', 'string'
5
+
6
+ column 'attribute:links', 'Embedded::WebLink', :alias => 'links', :collection => true
7
+ column 'family2:', 'string', :alias => :family2
8
+ column 'log:change', 'string', :alias => 'change_log', :collection => true
9
+
10
+ end
@@ -0,0 +1,14 @@
1
+ class AddAnimalsTable < BigRecord::Migration
2
+
3
+ def self.up
4
+ create_table :animals do |t|
5
+ t.family :attribute, :versions => 5
6
+ t.family :log, :versions => 100
7
+ end
8
+ end
9
+
10
+ def self.down
11
+ drop_table :animals
12
+ end
13
+
14
+ end
@@ -0,0 +1,9 @@
1
+ class AddAnimalsTable < BigRecord::Migration
2
+
3
+ def self.up
4
+ end
5
+
6
+ def self.down
7
+ end
8
+
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddBooksTable < BigRecord::Migration
2
+
3
+ def self.up
4
+ end
5
+
6
+ def self.down
7
+ end
8
+
9
+ end