activerecord-turntable 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +25 -0
- data/.rspec +3 -0
- data/Gemfile +25 -0
- data/Guardfile +9 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +290 -0
- data/Rakefile +101 -0
- data/activerecord-turntable.gemspec +47 -0
- data/lib/active_record/turntable.rb +58 -0
- data/lib/active_record/turntable/active_record_ext.rb +26 -0
- data/lib/active_record/turntable/active_record_ext/.gitkeep +0 -0
- data/lib/active_record/turntable/active_record_ext/abstract_adapter.rb +50 -0
- data/lib/active_record/turntable/active_record_ext/clever_load.rb +90 -0
- data/lib/active_record/turntable/active_record_ext/fixtures.rb +131 -0
- data/lib/active_record/turntable/active_record_ext/log_subscriber.rb +64 -0
- data/lib/active_record/turntable/active_record_ext/persistence.rb +95 -0
- data/lib/active_record/turntable/active_record_ext/schema_dumper.rb +107 -0
- data/lib/active_record/turntable/active_record_ext/sequencer.rb +28 -0
- data/lib/active_record/turntable/active_record_ext/transactions.rb +33 -0
- data/lib/active_record/turntable/algorithm.rb +7 -0
- data/lib/active_record/turntable/algorithm/.gitkeep +0 -0
- data/lib/active_record/turntable/algorithm/base.rb +11 -0
- data/lib/active_record/turntable/algorithm/range_algorithm.rb +37 -0
- data/lib/active_record/turntable/algorithm/range_bsearch_algorithm.rb +41 -0
- data/lib/active_record/turntable/base.rb +130 -0
- data/lib/active_record/turntable/cluster.rb +70 -0
- data/lib/active_record/turntable/compatible.rb +19 -0
- data/lib/active_record/turntable/config.rb +24 -0
- data/lib/active_record/turntable/connection_proxy.rb +218 -0
- data/lib/active_record/turntable/connection_proxy/mixable.rb +39 -0
- data/lib/active_record/turntable/error.rb +8 -0
- data/lib/active_record/turntable/helpers.rb +5 -0
- data/lib/active_record/turntable/helpers/test_helper.rb +25 -0
- data/lib/active_record/turntable/master_shard.rb +28 -0
- data/lib/active_record/turntable/migration.rb +132 -0
- data/lib/active_record/turntable/mixer.rb +203 -0
- data/lib/active_record/turntable/mixer/fader.rb +34 -0
- data/lib/active_record/turntable/mixer/fader/calculate_shards_sum_result.rb +15 -0
- data/lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb +24 -0
- data/lib/active_record/turntable/mixer/fader/select_shards_merge_result.rb +22 -0
- data/lib/active_record/turntable/mixer/fader/specified_shard.rb +12 -0
- data/lib/active_record/turntable/mixer/fader/update_shards_merge_result.rb +17 -0
- data/lib/active_record/turntable/pool_proxy.rb +56 -0
- data/lib/active_record/turntable/rack.rb +5 -0
- data/lib/active_record/turntable/rack/connection_management.rb +18 -0
- data/lib/active_record/turntable/railtie.rb +14 -0
- data/lib/active_record/turntable/railties/databases.rake +205 -0
- data/lib/active_record/turntable/seq_shard.rb +14 -0
- data/lib/active_record/turntable/sequencer.rb +46 -0
- data/lib/active_record/turntable/sequencer/api.rb +36 -0
- data/lib/active_record/turntable/sequencer/mysql.rb +32 -0
- data/lib/active_record/turntable/shard.rb +48 -0
- data/lib/active_record/turntable/sql_tree_patch.rb +199 -0
- data/lib/active_record/turntable/version.rb +5 -0
- data/lib/activerecord-turntable.rb +2 -0
- data/lib/generators/active_record/turntable/install_generator.rb +14 -0
- data/lib/generators/templates/turntable.yml +40 -0
- data/sample_app/.gitignore +16 -0
- data/sample_app/Gemfile +41 -0
- data/sample_app/README.rdoc +261 -0
- data/sample_app/Rakefile +7 -0
- data/sample_app/app/assets/images/rails.png +0 -0
- data/sample_app/app/assets/javascripts/application.js +15 -0
- data/sample_app/app/assets/stylesheets/application.css +13 -0
- data/sample_app/app/controllers/application_controller.rb +3 -0
- data/sample_app/app/helpers/application_helper.rb +2 -0
- data/sample_app/app/mailers/.gitkeep +0 -0
- data/sample_app/app/models/.gitkeep +0 -0
- data/sample_app/app/models/user.rb +4 -0
- data/sample_app/app/views/layouts/application.html.erb +14 -0
- data/sample_app/config.ru +4 -0
- data/sample_app/config/application.rb +65 -0
- data/sample_app/config/boot.rb +6 -0
- data/sample_app/config/database.yml +70 -0
- data/sample_app/config/environment.rb +5 -0
- data/sample_app/config/environments/development.rb +37 -0
- data/sample_app/config/environments/production.rb +67 -0
- data/sample_app/config/environments/test.rb +37 -0
- data/sample_app/config/initializers/backtrace_silencers.rb +7 -0
- data/sample_app/config/initializers/inflections.rb +15 -0
- data/sample_app/config/initializers/mime_types.rb +5 -0
- data/sample_app/config/initializers/secret_token.rb +7 -0
- data/sample_app/config/initializers/session_store.rb +8 -0
- data/sample_app/config/initializers/wrap_parameters.rb +14 -0
- data/sample_app/config/locales/en.yml +5 -0
- data/sample_app/config/routes.rb +58 -0
- data/sample_app/config/turntable.yml +64 -0
- data/sample_app/db/migrate/20120316073058_create_users.rb +11 -0
- data/sample_app/db/seeds.rb +7 -0
- data/sample_app/lib/assets/.gitkeep +0 -0
- data/sample_app/lib/tasks/.gitkeep +0 -0
- data/sample_app/log/.gitkeep +0 -0
- data/sample_app/public/404.html +26 -0
- data/sample_app/public/422.html +26 -0
- data/sample_app/public/500.html +25 -0
- data/sample_app/public/favicon.ico +0 -0
- data/sample_app/public/index.html +241 -0
- data/sample_app/public/robots.txt +5 -0
- data/sample_app/script/rails +6 -0
- data/sample_app/vendor/assets/javascripts/.gitkeep +0 -0
- data/sample_app/vendor/assets/stylesheets/.gitkeep +0 -0
- data/sample_app/vendor/plugins/.gitkeep +0 -0
- data/script/performance/algorithm +32 -0
- data/spec/active_record/turntable/active_record_ext/clever_load_spec.rb +81 -0
- data/spec/active_record/turntable/active_record_ext/persistence_spec.rb +151 -0
- data/spec/active_record/turntable/algorithm/range_algorithm_spec.rb +35 -0
- data/spec/active_record/turntable/algorithm_spec.rb +69 -0
- data/spec/active_record/turntable/base_spec.rb +13 -0
- data/spec/active_record/turntable/cluster_spec.rb +18 -0
- data/spec/active_record/turntable/config_spec.rb +17 -0
- data/spec/active_record/turntable/connection_proxy_spec.rb +186 -0
- data/spec/active_record/turntable/finder_spec.rb +27 -0
- data/spec/active_record/turntable/mixer/fader_spec.rb +4 -0
- data/spec/active_record/turntable/mixer_spec.rb +114 -0
- data/spec/active_record/turntable/shard_spec.rb +21 -0
- data/spec/active_record/turntable_spec.rb +30 -0
- data/spec/config/database.yml +45 -0
- data/spec/config/turntable.yml +17 -0
- data/spec/fabricators/.gitkeep +0 -0
- data/spec/fabricators/turntable_fabricator.rb +14 -0
- data/spec/migrations/.gitkeep +0 -0
- data/spec/migrations/001_create_users.rb +16 -0
- data/spec/migrations/002_create_user_statuses.rb +16 -0
- data/spec/migrations/003_create_cards.rb +14 -0
- data/spec/migrations/004_create_cards_users.rb +15 -0
- data/spec/spec_helper.rb +23 -0
- data/spec/test_models.rb +27 -0
- data/spec/turntable_helper.rb +29 -0
- metadata +367 -0
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# load models
|
2
|
+
require File.expand_path(File.join(File.dirname(File.dirname(__FILE__)),'./test_models'))
|
3
|
+
|
4
|
+
# Fabrication
|
5
|
+
Fabricator(:user_status) do
|
6
|
+
hp { (0..10).to_a.sample }
|
7
|
+
mp { (0..10).to_a.sample }
|
8
|
+
end
|
9
|
+
|
10
|
+
Fabricator(:user) do
|
11
|
+
nickname { Faker::Name.name }
|
12
|
+
user_status { Fabricator(:user_status) }
|
13
|
+
end
|
14
|
+
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateUsers < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :users do |t|
|
4
|
+
t.string :nickname
|
5
|
+
t.string :thumbnail_url
|
6
|
+
t.datetime :joined_at
|
7
|
+
t.datetime :deleted_at
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :users
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateUserStatuses < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :user_statuses do |t|
|
4
|
+
t.belongs_to :user, :null => false
|
5
|
+
t.integer :hp, :null => false, :default => 0
|
6
|
+
t.integer :mp, :null => false, :default => 0
|
7
|
+
t.datetime :deleted_at, :default => nil
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :user_statuses
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateCards < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :cards do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.integer :hp, :null => false, :default => 0
|
6
|
+
t.integer :mp, :null => false, :default => 0
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.down
|
12
|
+
drop_table :cards
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateCardsUsers < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :cards_users do |t|
|
4
|
+
t.belongs_to :card, :null => false
|
5
|
+
t.belongs_to :user, :null => false
|
6
|
+
t.datetime :deleted_at
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.down
|
13
|
+
drop_table :cards_users
|
14
|
+
end
|
15
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler/setup'
|
5
|
+
|
6
|
+
require 'activerecord-turntable'
|
7
|
+
require 'turntable_helper'
|
8
|
+
|
9
|
+
MIGRATIONS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), 'migrations'))
|
10
|
+
|
11
|
+
# Requires supporting files with custom matchers and macros, etc,
|
12
|
+
# in ./support/ and its subdirectories.
|
13
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
14
|
+
|
15
|
+
RSpec.configure do |config|
|
16
|
+
config.filter_run :focus => true
|
17
|
+
config.run_all_when_everything_filtered = true
|
18
|
+
|
19
|
+
config.mock_framework = :rr
|
20
|
+
|
21
|
+
config.before(:each) do
|
22
|
+
end
|
23
|
+
end
|
data/spec/test_models.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
class User < ActiveRecord::Base
|
3
|
+
# shard by surrogate_key
|
4
|
+
turntable :user_cluster, :id
|
5
|
+
sequencer
|
6
|
+
has_one :user_status
|
7
|
+
has_many :cards_user
|
8
|
+
end
|
9
|
+
|
10
|
+
class UserStatus < ActiveRecord::Base
|
11
|
+
# shard by other key
|
12
|
+
turntable :user_cluster, :user_id
|
13
|
+
sequencer
|
14
|
+
belongs_to :user
|
15
|
+
end
|
16
|
+
|
17
|
+
class Card < ActiveRecord::Base
|
18
|
+
belongs_to :cards_user
|
19
|
+
end
|
20
|
+
|
21
|
+
class CardsUser < ActiveRecord::Base
|
22
|
+
turntable :user_cluster, :user_id
|
23
|
+
sequencer
|
24
|
+
|
25
|
+
belongs_to :user
|
26
|
+
belongs_to :card
|
27
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
ActiveRecord::Base.configurations = YAML.load_file(File.join(File.dirname(__FILE__), 'config/database.yml'))
|
3
|
+
|
4
|
+
def reload_turntable!(config_file_name = nil)
|
5
|
+
ActiveRecord::Base.send(:include, ActiveRecord::Turntable)
|
6
|
+
ActiveRecord::Base.turntable_config_file = config_file_name
|
7
|
+
ActiveRecord::Turntable::Config.load!(ActiveRecord::Base.turntable_config_file, :test)
|
8
|
+
end
|
9
|
+
|
10
|
+
def establish_connection_to(env = "test")
|
11
|
+
silence_warnings {
|
12
|
+
Object.const_set('RAILS_ENV', env)
|
13
|
+
Object.const_set('Rails', Object.new)
|
14
|
+
stub(Rails).env { ActiveSupport::StringInquirer.new(RAILS_ENV) }
|
15
|
+
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
16
|
+
}
|
17
|
+
ActiveRecord::Base.establish_connection(env)
|
18
|
+
require File.expand_path(File.join(File.dirname(__FILE__),'./test_models'))
|
19
|
+
end
|
20
|
+
|
21
|
+
def truncate_shard
|
22
|
+
ActiveRecord::Base.descendants.each do |klass|
|
23
|
+
klass.delete_all
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def migrate(version)
|
28
|
+
ActiveRecord::Migrator.run(:up, MIGRATIONS_ROOT, version)
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,367 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: activerecord-turntable
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- gussan
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-04-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activerecord
|
16
|
+
requirement: &70194215920340 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.0.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70194215920340
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activesupport
|
27
|
+
requirement: &70194215919380 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.0.0
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70194215919380
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: sql_tree
|
38
|
+
requirement: &70194215918260 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - =
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.2.0
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70194215918260
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: bsearch
|
49
|
+
requirement: &70194215917060 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.5'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70194215917060
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: httpclient
|
60
|
+
requirement: &70194215920960 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :runtime
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70194215920960
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: &70194215919200 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ~>
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 0.9.2
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70194215919200
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rspec
|
82
|
+
requirement: &70194215671500 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *70194215671500
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: rr
|
93
|
+
requirement: &70194215671020 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *70194215671020
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: mysql2
|
104
|
+
requirement: &70194215670540 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: *70194215670540
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: fabrication
|
115
|
+
requirement: &70194215670060 !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
117
|
+
requirements:
|
118
|
+
- - ! '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
type: :development
|
122
|
+
prerelease: false
|
123
|
+
version_requirements: *70194215670060
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
name: faker
|
126
|
+
requirement: &70194215669580 !ruby/object:Gem::Requirement
|
127
|
+
none: false
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: *70194215669580
|
135
|
+
- !ruby/object:Gem::Dependency
|
136
|
+
name: activerecord-import
|
137
|
+
requirement: &70194215669100 !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
type: :development
|
144
|
+
prerelease: false
|
145
|
+
version_requirements: *70194215669100
|
146
|
+
- !ruby/object:Gem::Dependency
|
147
|
+
name: pry
|
148
|
+
requirement: &70194215668620 !ruby/object:Gem::Requirement
|
149
|
+
none: false
|
150
|
+
requirements:
|
151
|
+
- - ! '>='
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
type: :development
|
155
|
+
prerelease: false
|
156
|
+
version_requirements: *70194215668620
|
157
|
+
- !ruby/object:Gem::Dependency
|
158
|
+
name: guard-rspec
|
159
|
+
requirement: &70194215668140 !ruby/object:Gem::Requirement
|
160
|
+
none: false
|
161
|
+
requirements:
|
162
|
+
- - ! '>='
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '0'
|
165
|
+
type: :development
|
166
|
+
prerelease: false
|
167
|
+
version_requirements: *70194215668140
|
168
|
+
- !ruby/object:Gem::Dependency
|
169
|
+
name: growl
|
170
|
+
requirement: &70194215667620 !ruby/object:Gem::Requirement
|
171
|
+
none: false
|
172
|
+
requirements:
|
173
|
+
- - ! '>='
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '0'
|
176
|
+
type: :development
|
177
|
+
prerelease: false
|
178
|
+
version_requirements: *70194215667620
|
179
|
+
description: AcviveRecord Sharding plugin
|
180
|
+
email:
|
181
|
+
executables: []
|
182
|
+
extensions: []
|
183
|
+
extra_rdoc_files:
|
184
|
+
- LICENSE.txt
|
185
|
+
- README.rdoc
|
186
|
+
files:
|
187
|
+
- .document
|
188
|
+
- .gitignore
|
189
|
+
- .rspec
|
190
|
+
- Gemfile
|
191
|
+
- Guardfile
|
192
|
+
- LICENSE.txt
|
193
|
+
- README.rdoc
|
194
|
+
- Rakefile
|
195
|
+
- activerecord-turntable.gemspec
|
196
|
+
- lib/active_record/turntable.rb
|
197
|
+
- lib/active_record/turntable/active_record_ext.rb
|
198
|
+
- lib/active_record/turntable/active_record_ext/.gitkeep
|
199
|
+
- lib/active_record/turntable/active_record_ext/abstract_adapter.rb
|
200
|
+
- lib/active_record/turntable/active_record_ext/clever_load.rb
|
201
|
+
- lib/active_record/turntable/active_record_ext/fixtures.rb
|
202
|
+
- lib/active_record/turntable/active_record_ext/log_subscriber.rb
|
203
|
+
- lib/active_record/turntable/active_record_ext/persistence.rb
|
204
|
+
- lib/active_record/turntable/active_record_ext/schema_dumper.rb
|
205
|
+
- lib/active_record/turntable/active_record_ext/sequencer.rb
|
206
|
+
- lib/active_record/turntable/active_record_ext/transactions.rb
|
207
|
+
- lib/active_record/turntable/algorithm.rb
|
208
|
+
- lib/active_record/turntable/algorithm/.gitkeep
|
209
|
+
- lib/active_record/turntable/algorithm/base.rb
|
210
|
+
- lib/active_record/turntable/algorithm/range_algorithm.rb
|
211
|
+
- lib/active_record/turntable/algorithm/range_bsearch_algorithm.rb
|
212
|
+
- lib/active_record/turntable/base.rb
|
213
|
+
- lib/active_record/turntable/cluster.rb
|
214
|
+
- lib/active_record/turntable/compatible.rb
|
215
|
+
- lib/active_record/turntable/config.rb
|
216
|
+
- lib/active_record/turntable/connection_proxy.rb
|
217
|
+
- lib/active_record/turntable/connection_proxy/mixable.rb
|
218
|
+
- lib/active_record/turntable/error.rb
|
219
|
+
- lib/active_record/turntable/helpers.rb
|
220
|
+
- lib/active_record/turntable/helpers/test_helper.rb
|
221
|
+
- lib/active_record/turntable/master_shard.rb
|
222
|
+
- lib/active_record/turntable/migration.rb
|
223
|
+
- lib/active_record/turntable/mixer.rb
|
224
|
+
- lib/active_record/turntable/mixer/fader.rb
|
225
|
+
- lib/active_record/turntable/mixer/fader/calculate_shards_sum_result.rb
|
226
|
+
- lib/active_record/turntable/mixer/fader/insert_shards_merge_result.rb
|
227
|
+
- lib/active_record/turntable/mixer/fader/select_shards_merge_result.rb
|
228
|
+
- lib/active_record/turntable/mixer/fader/specified_shard.rb
|
229
|
+
- lib/active_record/turntable/mixer/fader/update_shards_merge_result.rb
|
230
|
+
- lib/active_record/turntable/pool_proxy.rb
|
231
|
+
- lib/active_record/turntable/rack.rb
|
232
|
+
- lib/active_record/turntable/rack/connection_management.rb
|
233
|
+
- lib/active_record/turntable/railtie.rb
|
234
|
+
- lib/active_record/turntable/railties/databases.rake
|
235
|
+
- lib/active_record/turntable/seq_shard.rb
|
236
|
+
- lib/active_record/turntable/sequencer.rb
|
237
|
+
- lib/active_record/turntable/sequencer/api.rb
|
238
|
+
- lib/active_record/turntable/sequencer/mysql.rb
|
239
|
+
- lib/active_record/turntable/shard.rb
|
240
|
+
- lib/active_record/turntable/sql_tree_patch.rb
|
241
|
+
- lib/active_record/turntable/version.rb
|
242
|
+
- lib/activerecord-turntable.rb
|
243
|
+
- lib/generators/active_record/turntable/install_generator.rb
|
244
|
+
- lib/generators/templates/turntable.yml
|
245
|
+
- sample_app/.gitignore
|
246
|
+
- sample_app/Gemfile
|
247
|
+
- sample_app/README.rdoc
|
248
|
+
- sample_app/Rakefile
|
249
|
+
- sample_app/app/assets/images/rails.png
|
250
|
+
- sample_app/app/assets/javascripts/application.js
|
251
|
+
- sample_app/app/assets/stylesheets/application.css
|
252
|
+
- sample_app/app/controllers/application_controller.rb
|
253
|
+
- sample_app/app/helpers/application_helper.rb
|
254
|
+
- sample_app/app/mailers/.gitkeep
|
255
|
+
- sample_app/app/models/.gitkeep
|
256
|
+
- sample_app/app/models/user.rb
|
257
|
+
- sample_app/app/views/layouts/application.html.erb
|
258
|
+
- sample_app/config.ru
|
259
|
+
- sample_app/config/application.rb
|
260
|
+
- sample_app/config/boot.rb
|
261
|
+
- sample_app/config/database.yml
|
262
|
+
- sample_app/config/environment.rb
|
263
|
+
- sample_app/config/environments/development.rb
|
264
|
+
- sample_app/config/environments/production.rb
|
265
|
+
- sample_app/config/environments/test.rb
|
266
|
+
- sample_app/config/initializers/backtrace_silencers.rb
|
267
|
+
- sample_app/config/initializers/inflections.rb
|
268
|
+
- sample_app/config/initializers/mime_types.rb
|
269
|
+
- sample_app/config/initializers/secret_token.rb
|
270
|
+
- sample_app/config/initializers/session_store.rb
|
271
|
+
- sample_app/config/initializers/wrap_parameters.rb
|
272
|
+
- sample_app/config/locales/en.yml
|
273
|
+
- sample_app/config/routes.rb
|
274
|
+
- sample_app/config/turntable.yml
|
275
|
+
- sample_app/db/migrate/20120316073058_create_users.rb
|
276
|
+
- sample_app/db/seeds.rb
|
277
|
+
- sample_app/lib/assets/.gitkeep
|
278
|
+
- sample_app/lib/tasks/.gitkeep
|
279
|
+
- sample_app/log/.gitkeep
|
280
|
+
- sample_app/public/404.html
|
281
|
+
- sample_app/public/422.html
|
282
|
+
- sample_app/public/500.html
|
283
|
+
- sample_app/public/favicon.ico
|
284
|
+
- sample_app/public/index.html
|
285
|
+
- sample_app/public/robots.txt
|
286
|
+
- sample_app/script/rails
|
287
|
+
- sample_app/vendor/assets/javascripts/.gitkeep
|
288
|
+
- sample_app/vendor/assets/stylesheets/.gitkeep
|
289
|
+
- sample_app/vendor/plugins/.gitkeep
|
290
|
+
- script/performance/algorithm
|
291
|
+
- spec/active_record/turntable/active_record_ext/clever_load_spec.rb
|
292
|
+
- spec/active_record/turntable/active_record_ext/persistence_spec.rb
|
293
|
+
- spec/active_record/turntable/algorithm/range_algorithm_spec.rb
|
294
|
+
- spec/active_record/turntable/algorithm_spec.rb
|
295
|
+
- spec/active_record/turntable/base_spec.rb
|
296
|
+
- spec/active_record/turntable/cluster_spec.rb
|
297
|
+
- spec/active_record/turntable/config_spec.rb
|
298
|
+
- spec/active_record/turntable/connection_proxy_spec.rb
|
299
|
+
- spec/active_record/turntable/finder_spec.rb
|
300
|
+
- spec/active_record/turntable/mixer/fader_spec.rb
|
301
|
+
- spec/active_record/turntable/mixer_spec.rb
|
302
|
+
- spec/active_record/turntable/shard_spec.rb
|
303
|
+
- spec/active_record/turntable_spec.rb
|
304
|
+
- spec/config/database.yml
|
305
|
+
- spec/config/turntable.yml
|
306
|
+
- spec/fabricators/.gitkeep
|
307
|
+
- spec/fabricators/turntable_fabricator.rb
|
308
|
+
- spec/migrations/.gitkeep
|
309
|
+
- spec/migrations/001_create_users.rb
|
310
|
+
- spec/migrations/002_create_user_statuses.rb
|
311
|
+
- spec/migrations/003_create_cards.rb
|
312
|
+
- spec/migrations/004_create_cards_users.rb
|
313
|
+
- spec/spec_helper.rb
|
314
|
+
- spec/test_models.rb
|
315
|
+
- spec/turntable_helper.rb
|
316
|
+
homepage: https://github.com/drecom/activerecord-turntable
|
317
|
+
licenses:
|
318
|
+
- MIT
|
319
|
+
post_install_message:
|
320
|
+
rdoc_options: []
|
321
|
+
require_paths:
|
322
|
+
- lib
|
323
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
324
|
+
none: false
|
325
|
+
requirements:
|
326
|
+
- - ! '>='
|
327
|
+
- !ruby/object:Gem::Version
|
328
|
+
version: '0'
|
329
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
330
|
+
none: false
|
331
|
+
requirements:
|
332
|
+
- - ! '>='
|
333
|
+
- !ruby/object:Gem::Version
|
334
|
+
version: '0'
|
335
|
+
requirements: []
|
336
|
+
rubyforge_project: activerecord-turntable
|
337
|
+
rubygems_version: 1.8.16
|
338
|
+
signing_key:
|
339
|
+
specification_version: 3
|
340
|
+
summary: ActiveRecord Sharding plugin
|
341
|
+
test_files:
|
342
|
+
- spec/active_record/turntable/active_record_ext/clever_load_spec.rb
|
343
|
+
- spec/active_record/turntable/active_record_ext/persistence_spec.rb
|
344
|
+
- spec/active_record/turntable/algorithm/range_algorithm_spec.rb
|
345
|
+
- spec/active_record/turntable/algorithm_spec.rb
|
346
|
+
- spec/active_record/turntable/base_spec.rb
|
347
|
+
- spec/active_record/turntable/cluster_spec.rb
|
348
|
+
- spec/active_record/turntable/config_spec.rb
|
349
|
+
- spec/active_record/turntable/connection_proxy_spec.rb
|
350
|
+
- spec/active_record/turntable/finder_spec.rb
|
351
|
+
- spec/active_record/turntable/mixer/fader_spec.rb
|
352
|
+
- spec/active_record/turntable/mixer_spec.rb
|
353
|
+
- spec/active_record/turntable/shard_spec.rb
|
354
|
+
- spec/active_record/turntable_spec.rb
|
355
|
+
- spec/config/database.yml
|
356
|
+
- spec/config/turntable.yml
|
357
|
+
- spec/fabricators/.gitkeep
|
358
|
+
- spec/fabricators/turntable_fabricator.rb
|
359
|
+
- spec/migrations/.gitkeep
|
360
|
+
- spec/migrations/001_create_users.rb
|
361
|
+
- spec/migrations/002_create_user_statuses.rb
|
362
|
+
- spec/migrations/003_create_cards.rb
|
363
|
+
- spec/migrations/004_create_cards_users.rb
|
364
|
+
- spec/spec_helper.rb
|
365
|
+
- spec/test_models.rb
|
366
|
+
- spec/turntable_helper.rb
|
367
|
+
has_rdoc:
|