Package org.apache.solr.common.cloud
Class ClusterProperties
java.lang.Object
org.apache.solr.common.cloud.ClusterProperties
Interact with solr cluster 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.getClusterProperty(String, Object)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClusterProperties(SolrZkClient client) Creates a ClusterProperties object using a provided SolrZkClient -
Method Summary
Modifier and TypeMethodDescriptionReturn 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.voidSet this object at the json path
-
Field Details
-
EXT_PROPRTTY_PREFIX
- See Also:
-
-
Constructor Details
-
ClusterProperties
Creates a ClusterProperties object using a provided SolrZkClient
-
-
Method Details
-
getClusterProperty
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
-
getClusterProperty
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
-
getClusterProperties
Return the cluster properties- Throws:
IOException- if there is an error reading properties from the cluster
-
setClusterProperties
public void setClusterProperties(Map<String, Object> properties) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException- Throws:
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
update
public void update(org.apache.solr.common.MapWriter obj, String... path) throws org.apache.zookeeper.KeeperException, InterruptedException Set this object at the json path- Parameters:
obj- the Object to be setpath- the json path- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
setClusterProperty
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
-