org.apache.solr.client.solrj.cloud.autoscaling

## Class Policy

- java.lang.Object
- - org.apache.solr.client.solrj.cloud.autoscaling.Policy

All Implemented Interfaces:
  MapSerializable, MapWriter, NavigableObject

Deprecated.
to be removed in Solr 9.0 (see SOLR-14656)

    public class Policy
    extends Object
    implements MapWriter

The class that reads, parses and applies policies specified in autoscaling.json Create one instance of this class per unique autoscaling.json. This is immutable and is thread-safe Create a fresh new session for each use.

### Nested Class Summary

Nested Classes
`static class` `Policy.Session` Deprecated.
`static class` `Policy.SortParam` Deprecated.

### Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter

`MapWriter.EntryWriter`

### Field Summary

Fields
`static String` `ANY` Deprecated.
`static String` `CLUSTER_POLICY` Deprecated.
`static String` `CLUSTER_PREFERENCES` Deprecated.
`static List<Preference>` `DEFAULT_PREFERENCES` Deprecated.
`static String` `EACH` Deprecated.
`static Set<String>` `GLOBAL_ONLY_TAGS` Deprecated.
`static String` `POLICIES` Deprecated.
`static String` `POLICY` Deprecated.

### Constructor Summary

Constructors
Constructor and Description
`Policy()` Deprecated.
`Policy(Map<String,Object> jsonMap)` Deprecated.
`Policy(Map<String,Object> jsonMap, int version)` Deprecated.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
`static Map<String,List<Clause>>` `clausesFromMap(Map<String,List<Map<String,Object>>> map, List<String> newParams)` Deprecated.
`Policy.Session` `createSession(SolrCloudManager cloudManager)` Deprecated.
`Policy.Session` `createSession(SolrCloudManager cloudManager, org.apache.solr.client.solrj.cloud.autoscaling.Policy.Transaction tx)` Deprecated.
`boolean` `equals(Object o)` Deprecated.
`List<Clause>` `getClusterPolicy()` Deprecated.
`List<Preference>` `getClusterPreferences()` Deprecated.
`List<String>` `getParamNames()` Deprecated.
`List<Pair<String,Variable.Type>>` `getParams()` Deprecated.
`List<String>` `getPerReplicaAttributes()` Deprecated.
`Map<String,List<Clause>>` `getPolicies()` Deprecated.
`int` `getZkVersion()` Deprecated.
`int` `hashCode()` Deprecated.
`boolean` `isEmpty()` Deprecated.
`boolean` `isEmptyPreferences()` Deprecated.
`static List<Clause>` `mergePolicies(String coll, List<Clause> collPolicy, List<Clause> globalPolicy)` Deprecated.
`String` `toString()` Deprecated.
`Policy` `withClusterPolicy(List<Clause> clusterPolicy)` Deprecated.
`Policy` `withClusterPreferences(List<Preference> clusterPreferences)` Deprecated.
`Policy` `withParams(List<String> params)` Deprecated.
`Policy` `withPolicies(Map<String,List<Clause>> policies)` Deprecated.
`void` `writeMap(MapWriter.EntryWriter ew)` Deprecated.

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.apache.solr.common.MapWriter

`jsonStr, toMap`

### Methods inherited from interface org.apache.solr.common.NavigableObject

`_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size`

### Field Detail

#### POLICY

    public static final String POLICY

Deprecated.

See Also:
  Constant Field Values

#### EACH

    public static final String EACH

Deprecated.

See Also:
  Constant Field Values

#### ANY

    public static final String ANY

Deprecated.

See Also:
  Constant Field Values

#### POLICIES

    public static final String POLICIES

Deprecated.

See Also:
  Constant Field Values

#### CLUSTER_POLICY

    public static final String CLUSTER_POLICY

Deprecated.

See Also:
  Constant Field Values

#### CLUSTER_PREFERENCES

    public static final String CLUSTER_PREFERENCES

Deprecated.

See Also:
  Constant Field Values

#### GLOBAL_ONLY_TAGS

    public static final Set<String> GLOBAL_ONLY_TAGS

Deprecated.

#### DEFAULT_PREFERENCES

    public static final List<Preference> DEFAULT_PREFERENCES

Deprecated.

### Constructor Detail

#### Policy

    public Policy()

Deprecated.

#### Policy

    public Policy(Map<String,Object> jsonMap)

Deprecated.

#### Policy

    public Policy(Map<String,Object> jsonMap,
                  int version)

Deprecated.

### Method Detail

#### withPolicies

    public Policy withPolicies(Map<String,List<Clause>> policies)

Deprecated.

#### withClusterPreferences

    public Policy withClusterPreferences(List<Preference> clusterPreferences)

Deprecated.

#### withClusterPolicy

    public Policy withClusterPolicy(List<Clause> clusterPolicy)

Deprecated.

#### withParams

    public Policy withParams(List<String> params)

Deprecated.

#### getClusterPolicy

    public List<Clause> getClusterPolicy()

Deprecated.

#### getClusterPreferences

    public List<Preference> getClusterPreferences()

Deprecated.

#### writeMap

    public void writeMap(MapWriter.EntryWriter ew)
                  throws IOException

Deprecated.

Specified by:
  `writeMap` in interface `MapWriter`
Throws:
  `IOException`

#### equals

    public boolean equals(Object o)

Deprecated.

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Deprecated.

Overrides:
  `hashCode` in class `Object`

#### clausesFromMap

    public static Map<String,List<Clause>> clausesFromMap(Map<String,List<Map<String,Object>>> map,
                                                          List<String> newParams)

Deprecated.

#### createSession

    public Policy.Session createSession(SolrCloudManager cloudManager)

Deprecated.

#### createSession

    public Policy.Session createSession(SolrCloudManager cloudManager,
                                        org.apache.solr.client.solrj.cloud.autoscaling.Policy.Transaction tx)

Deprecated.

#### mergePolicies

    public static List<Clause> mergePolicies(String coll,
                                             List<Clause> collPolicy,
                                             List<Clause> globalPolicy)

Deprecated.

#### getPolicies

    public Map<String,List<Clause>> getPolicies()

Deprecated.

#### getParams

    public List<Pair<String,Variable.Type>> getParams()

Deprecated.

#### getParamNames

    public List<String> getParamNames()

Deprecated.

#### getPerReplicaAttributes

    public List<String> getPerReplicaAttributes()

Deprecated.

#### getZkVersion

    public int getZkVersion()

Deprecated.

#### toString

    public String toString()

Deprecated.

Overrides:
  `toString` in class `Object`

#### isEmpty

    public boolean isEmpty()

Deprecated.

#### isEmptyPreferences

    public boolean isEmptyPreferences()

Deprecated.

Returns:
  true if no preferences were specified by the user, false otherwise