Class: Solr::Replicator

Inherits:
Object
  • Object
show all
Defined in:
lib/openteam/capistrano/solr/solr.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options)
  self.remote = Solr.new options[:remote]
  self.local = Solr.new options[:local]
end

Instance Attribute Details

#base_local_index_versionObject

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

#localObject

Returns the value of attribute local.



7
8
9
# File 'lib/openteam/capistrano/solr/solr.rb', line 7

def local
  @local
end

#remoteObject

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

#replicateObject



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