Class: Solr::Replicator
- Inherits:
-
Object
- Object
- Solr::Replicator
- Defined in:
- lib/openteam/capistrano/solr/solr.rb
Instance Attribute Summary collapse
-
#base_local_index_version ⇒ Object
Returns the value of attribute base_local_index_version.
-
#local ⇒ Object
Returns the value of attribute local.
-
#remote ⇒ Object
Returns the value of attribute remote.
Instance Method Summary collapse
-
#initialize(options) ⇒ Replicator
constructor
A new instance of Replicator.
- #replicate ⇒ Object
Constructor Details
#initialize(options) ⇒ Replicator
Returns a new instance of Replicator.
9 10 11 12 |
# File 'lib/openteam/capistrano/solr/solr.rb', line 9 def initialize() self.remote = Solr.new [:remote] self.local = Solr.new [:local] end |
Instance Attribute Details
#base_local_index_version ⇒ Object
Returns the value of attribute base_local_index_version.
7 8 9 |
# File 'lib/openteam/capistrano/solr/solr.rb', line 7 def base_local_index_version @base_local_index_version end |
#local ⇒ Object
Returns the value of attribute local.
7 8 9 |
# File 'lib/openteam/capistrano/solr/solr.rb', line 7 def local @local end |
#remote ⇒ Object
Returns the value of attribute remote.
7 8 9 |
# File 'lib/openteam/capistrano/solr/solr.rb', line 7 def remote @remote end |
Instance Method Details
#replicate ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/openteam/capistrano/solr/solr.rb', line 14 def replicate self.base_local_index_version = local.index_version if base_local_index_version == remote.index_version puts 'No need for replication. The local index and the remote index are the same.' else really_replicate end end |