Class: Solr::Cloud::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/solr/cloud/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#collections_state_managerObject (readonly)

Returns the value of attribute collections_state_manager.



9
10
11
# File 'lib/solr/cloud/configuration.rb', line 9

def collections_state_manager
  @collections_state_manager
end

#zookeeper_auth_passwordObject

Returns the value of attribute zookeeper_auth_password.



7
8
9
# File 'lib/solr/cloud/configuration.rb', line 7

def zookeeper_auth_password
  @zookeeper_auth_password
end

#zookeeper_auth_userObject

Returns the value of attribute zookeeper_auth_user.



7
8
9
# File 'lib/solr/cloud/configuration.rb', line 7

def zookeeper_auth_user
  @zookeeper_auth_user
end

#zookeeper_urlObject

Returns the value of attribute zookeeper_url.



7
8
9
# File 'lib/solr/cloud/configuration.rb', line 7

def zookeeper_url
  @zookeeper_url
end

Instance Method Details

#build_zookeeper_connectionObject



20
21
22
23
24
25
# File 'lib/solr/cloud/configuration.rb', line 20

def build_zookeeper_connection
  zookeeper_url = zookeeper_url.is_a?(Array) ? zookeeper_url.join(',') : zookeeper_url
  Solr::Cloud::ZookeeperConnection.new(zookeeper_url: zookeeper_url,
                                       zookeeper_auth_user: zookeeper_auth_user,
                                       zookeeper_auth_password: zookeeper_auth_password)
end

#cloud_enabled?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/solr/cloud/configuration.rb', line 16

def cloud_enabled?
  !@collections_state_manager.nil?
end

#enable_solr_cloud!(collections) ⇒ Object



11
12
13
14
# File 'lib/solr/cloud/configuration.rb', line 11

def enable_solr_cloud!(collections)
  @collections_state_manager = Solr::Cloud::CollectionsStateManager.new(zookeeper: build_zookeeper_connection,
                                                                        collections: collections)
end