public class ClusterProperties extends Object
ZkStateReader.getClusterProperty(String, Object)
Modifier and Type | Field and Description |
---|---|
static String |
EXT_PROPRTTY_PREFIX |
Constructor and Description |
---|
ClusterProperties(SolrZkClient client)
Creates a ClusterProperties object using a provided SolrZkClient
|
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
getClusterProperties()
Return the cluster properties
|
<T> T |
getClusterProperty(List<String> key,
T defaultValue)
Read the value of a cluster property, returning a default if it is not set
|
<T> T |
getClusterProperty(String key,
T defaultValue)
Read the value of a cluster property, returning a default if it is not set
|
void |
setClusterProperties(Map<String,Object> properties) |
void |
setClusterProperty(String propertyName,
Object propertyValue)
This method sets a cluster property.
|
public static final String EXT_PROPRTTY_PREFIX
public ClusterProperties(SolrZkClient client)
public <T> T getClusterProperty(String key, T defaultValue) throws IOException
T
- the type of the propertykey
- the property name or the full path to the property.defaultValue
- the default valueIOException
- if there is an error reading the value from the clusterpublic <T> T getClusterProperty(List<String> key, T defaultValue) throws IOException
T
- the type of the propertykey
- the property name or the full path to the property as a list of parts.defaultValue
- the default valueIOException
- if there is an error reading the value from the clusterpublic Map<String,Object> getClusterProperties() throws IOException
IOException
- if there is an error reading properties from the clusterpublic void setClusterProperties(Map<String,Object> properties) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
IOException
org.apache.zookeeper.KeeperException
InterruptedException
public void setClusterProperty(String propertyName, Object propertyValue) throws IOException
propertyName
- The property name to be set.propertyValue
- The value of the property, could also be a nested structure.IOException
- if there is an error writing data to the clusterCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.