Package org.apache.solr.common.cloud
Class CollectionProperties
java.lang.Object
org.apache.solr.common.cloud.CollectionProperties
Interact with solr collection properties
Note that all methods on this class make calls to ZK on every invocation. For read-only
eventually-consistent uses, clients should instead call ZkStateReader.getCollectionProperties(String)
-
Constructor Summary
ConstructorsConstructorDescriptionCollectionProperties(SolrZkClient client) Creates a CollectionProperties object using a provided SolrZkClient -
Method Summary
Modifier and TypeMethodDescriptiongetCollectionProperties(String collection) Return the collection propertiesgetCollectionProperty(String collection, String key, String defaultValue) Read the value of a collection property, returning a default if it is not setvoidsetCollectionProperty(String collection, String propertyName, String propertyValue) This method sets a collection property.
-
Constructor Details
-
CollectionProperties
Creates a CollectionProperties object using a provided SolrZkClient
-
-
Method Details
-
getCollectionProperty
public String getCollectionProperty(String collection, String key, String defaultValue) throws IOException Read the value of a collection property, returning a default if it is not set- Parameters:
key- the property namedefaultValue- the default value- Returns:
- the property value
- Throws:
IOException- if there is an error reading the value from zookeeper
-
getCollectionProperties
Return the collection properties- Throws:
IOException- if there is an error reading properties from zookeeper
-
setCollectionProperty
public void setCollectionProperty(String collection, String propertyName, String propertyValue) throws IOException This method sets a collection property.- Parameters:
collection- The property name to be set.propertyName- The property name to be set.propertyValue- The value of the property.- Throws:
IOException- if there is an error writing data to zookeeper
-