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 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)`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClusterProperties(SolrZkClient client)` Creates a ClusterProperties object using a provided SolrZkClient

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Map<String,Object>` | `getClusterProperties()` Return the cluster properties
    `<T> T` | `getClusterProperty(String key, T defaultValue)` Read the value of a cluster property, returning a default if it is not set
    `void` | `setClusterProperty(String propertyName, String propertyValue)` This method sets a cluster property.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ClusterProperties

          public ClusterProperties(SolrZkClient client)

      Creates a ClusterProperties object using a provided SolrZkClient

  - ### Method Detail

    - #### getClusterProperty

          public <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
        `defaultValue` - the default value
      Returns:
        the property value
      Throws:
        `IOException` - if there is an error reading the value from the cluster

    - #### getClusterProperties

          public Map<String,Object> getClusterProperties()
                                                  throws IOException

      Return the cluster properties
      Throws:
        `IOException` - if there is an error reading properties from the cluster

    - #### setClusterProperty

          public void setClusterProperty(String propertyName,
                                         String propertyValue)
                                  throws IOException

      This method sets a cluster property.
      Parameters:
        `propertyName` - The property name to be set.
        `propertyValue` - The value of the property.
      Throws:
        `IOException` - if there is an error writing data to the cluster

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.