Package org.apache.solr.common.cloud
Class CollectionProperties
- java.lang.Object
-
- org.apache.solr.common.cloud.CollectionProperties
-
public class CollectionProperties extends Object
Interact with solr collection propertiesNote 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
Constructors Constructor Description CollectionProperties(SolrZkClient client)
Creates a CollectionProperties object using a provided SolrZkClient
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
getCollectionProperties(String collection)
Return the collection propertiesString
getCollectionProperty(String collection, String key, String defaultValue)
Read the value of a collection property, returning a default if it is not setvoid
setCollectionProperty(String collection, String propertyName, String propertyValue)
This method sets a collection property.
-
-
-
Constructor Detail
-
CollectionProperties
public CollectionProperties(SolrZkClient client)
Creates a CollectionProperties object using a provided SolrZkClient
-
-
Method Detail
-
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
public Map<String,String> getCollectionProperties(String collection) throws IOException
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
-
-