Package org.apache.solr.common.cloud
Class ClusterProperties
- java.lang.Object
- 
- org.apache.solr.common.cloud.ClusterProperties
 
- 
 public class ClusterProperties extends Object Interact with solr cluster 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.getClusterProperty(String, Object)
- 
- 
Field SummaryFields Modifier and Type Field Description static StringEXT_PROPRTTY_PREFIX
 - 
Constructor SummaryConstructors Constructor Description ClusterProperties(SolrZkClient client)Creates a ClusterProperties object using a provided SolrZkClient
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>getClusterProperties()Return the cluster properties<T> TgetClusterProperty(String key, T defaultValue)Read the value of a cluster property, returning a default if it is not set<T> TgetClusterProperty(List<String> key, T defaultValue)Read the value of a cluster property, returning a default if it is not setvoidsetClusterProperties(Map<String,Object> properties)voidsetClusterProperty(String propertyName, Object propertyValue)This method sets a cluster property.voidupdate(org.apache.solr.common.MapWriter obj, String... path)Set this object at the json path
 
- 
- 
- 
Field Detail- 
EXT_PROPRTTY_PREFIXpublic static final String EXT_PROPRTTY_PREFIX - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
ClusterPropertiespublic ClusterProperties(SolrZkClient client) Creates a ClusterProperties object using a provided SolrZkClient
 
- 
 - 
Method Detail- 
getClusterPropertypublic <T> T getClusterProperty(String key, T defaultValue) throws IOException Read the value of a cluster property, returning a default if it is not set- Type Parameters:
- T- the type of the property
- Parameters:
- key- the property name or the full path to the property.
- defaultValue- the default value
- Returns:
- the property value
- Throws:
- IOException- if there is an error reading the value from the cluster
 
 - 
getClusterPropertypublic <T> T getClusterProperty(List<String> key, T defaultValue) throws IOException Read the value of a cluster property, returning a default if it is not set- Type Parameters:
- T- the type of the property
- Parameters:
- key- the property name or the full path to the property as a list of parts.
- defaultValue- the default value
- Returns:
- the property value
- Throws:
- IOException- if there is an error reading the value from the cluster
 
 - 
getClusterPropertiespublic Map<String,Object> getClusterProperties() throws IOException Return the cluster properties- Throws:
- IOException- if there is an error reading properties from the cluster
 
 - 
setClusterPropertiespublic void setClusterProperties(Map<String,Object> properties) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException - Throws:
- IOException
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
updatepublic void update(org.apache.solr.common.MapWriter obj, String... path) throws org.apache.zookeeper.KeeperException, InterruptedExceptionSet this object at the json path- Parameters:
- obj- the Object to be set
- path- the json path
- Throws:
- org.apache.zookeeper.KeeperException
- InterruptedException
 
 - 
setClusterPropertypublic void setClusterProperty(String propertyName, Object propertyValue) throws IOException This method sets a cluster property.- Parameters:
- propertyName- The property name to be set.
- propertyValue- The value of the property, could also be a nested structure.
- Throws:
- IOException- if there is an error writing data to the cluster
 
 
- 
 
-