Module: NoBrainer::Document::TableConfig
- Extended by:
- ActiveSupport::Concern, Autoload
- Defined in:
- lib/no_brainer/document/table_config.rb
Defined Under Namespace
Modules: ClassMethods
Classes: Synchronizer
Constant Summary
collapse
- VALID_TABLE_CONFIG_OPTIONS =
[:name, :durability, :shards, :replicas, :primary_replica_tag, :nonvoting_replica_tags, :write_acks]
Class Method Summary
collapse
Methods included from Autoload
autoload, autoload_and_include, eager_autoload, eager_load!, extended
Class Method Details
.drop! ⇒ Object
119
120
121
|
# File 'lib/no_brainer/document/table_config.rb', line 119
def drop!
NoBrainer.run { |r| r.db_drop(NoBrainer.current_db) }
end
|
.purge! ⇒ Object
123
124
125
126
127
128
129
130
|
# File 'lib/no_brainer/document/table_config.rb', line 123
def purge!
NoBrainer.run { |r| r.table_list }.each do |table_name|
next if table_name == NoBrainer::Document::Index::MetaStore.table_name
NoBrainer.run { |r| r.table(table_name).delete }
end
true
end
|
.rebalance(options = {}) ⇒ Object
112
113
114
115
116
117
|
# File 'lib/no_brainer/document/table_config.rb', line 112
def rebalance(options={})
NoBrainer.run { |r| r.table_list }.each do |table_name|
NoBrainer.run { |r| r.table(table_name).rebalance }
end
true
end
|
.sync_indexes(options = {}) ⇒ Object
.sync_schema(options = {}) ⇒ Object
107
108
109
110
|
# File 'lib/no_brainer/document/table_config.rb', line 107
def sync_schema(options={})
sync_table_config(options)
sync_indexes(options)
end
|
.sync_table_config(options = {}) ⇒ Object