Class: SolrMakr::Commands::PushConfig Private

Inherits:
ActiveInteraction::Base
  • Object
show all
Includes:
AbstractCommand
Defined in:
lib/solr_makr/commands/push_config.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary

Constants included from Utility

Utility::REQUIRED_SOLR_NODES

Instance Attribute Summary collapse

Attributes included from BufferInteraction

#buffer

Instance Method Summary collapse

Methods included from AbstractCommand

#expect_success!, #fetch_configset, #local_configuration

Methods included from Utility

default_table, default_table_options!, hash_to_table, looks_like_a_valid_configset?, path_to_configset

Methods included from BufferInteraction

#build_buffer, #compose_buffer

Instance Attribute Details

#remoteObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/solr_makr/commands/push_config.rb', line 11

def remote
  @remote
end

Instance Method Details

#executeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/solr_makr/commands/push_config.rb', line 13

def execute
  configset_directory = fetch_configset(configset)

  compose_buffer SolrMakr::Configsets::PushToZookeeper, name: name, directory: configset_directory

  buffer.ok "Pushed configuration named `#{name}` to zookeeper."

  @remote = SolrMakr::Configsets::Remote.new name: name

  if reload
    remote.dependent_collections.each do |collection|
      response = solr_client.reload name: collection

      if response.success?
        buffer.ok "Reloaded collection: `#{collection}`"
      else
        buffer.failure "Couldn't reload collection: `#{collection}`: #{response.failure}"
      end
    end
  end
end