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

## Class PolicyHelper

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

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

    public class PolicyHelper
    extends Object

### Nested Class Summary

Nested Classes
`static class` `PolicyHelper.SessionWrapper` Deprecated.
`static class` `PolicyHelper.Status` Deprecated.

### Field Summary

Fields
`static int` `SESSION_EXPIRY` Deprecated.

### Constructor Summary

Constructors
Constructor and Description
`PolicyHelper()` Deprecated.

### Method Summary

All Methods Static Methods Concrete Methods Deprecated Methods
`static MapWriter` `getDiagnostics(Policy.Session session)` Deprecated.
`static MapWriter` `getDiagnostics(Policy policy, SolrCloudManager cloudManager)` Deprecated.
`static PolicyHelper.SessionWrapper` `getLastSessionWrapper(boolean clear)` Deprecated. Use this to get the last used session wrapper in this thread
`static List<ReplicaPosition>` `getReplicaLocations(String collName, AutoScalingConfig autoScalingConfig, SolrCloudManager cloudManager, Map<String,String> optionalPolicyMapping, List<String> shardNames, int nrtReplicas, int tlogReplicas, int pullReplicas, List<String> nodesList)` Deprecated.
`static PolicyHelper.SessionWrapper` `getSession(SolrCloudManager cloudManager)` Deprecated. How to get a shared Policy Session 1) call `getSession(SolrCloudManager)` 2) compute all suggestions 3) call `PolicyHelper.SessionWrapper.returnSession(Policy.Session)` 4) perform all suggestions 5) call `PolicyHelper.SessionWrapper.release()`
`static List<Suggester.SuggestionInfo>` `getSuggestions(AutoScalingConfig autoScalingConf, SolrCloudManager cloudManager)` Deprecated.
`static List<Suggester.SuggestionInfo>` `getSuggestions(AutoScalingConfig autoScalingConf, SolrCloudManager cloudManager, int max, int timeoutInSecs, SolrParams params)` Deprecated.
`static List<Suggester.SuggestionInfo>` `getSuggestions(AutoScalingConfig autoScalingConf, SolrCloudManager cloudManager, SolrParams params)` Deprecated.
`static void` `logState(SolrCloudManager cloudManager, Suggester suggester)` Deprecated. Use this to dump the state of a system and to generate a testcase

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

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

### Field Detail

#### SESSION_EXPIRY

    public static final int SESSION_EXPIRY

Deprecated.

See Also:
  Constant Field Values

### Constructor Detail

#### PolicyHelper

    public PolicyHelper()

Deprecated.

### Method Detail

#### getReplicaLocations

    public static List<ReplicaPosition> getReplicaLocations(String collName,
                                                            AutoScalingConfig autoScalingConfig,
                                                            SolrCloudManager cloudManager,
                                                            Map<String,String> optionalPolicyMapping,
                                                            List<String> shardNames,
                                                            int nrtReplicas,
                                                            int tlogReplicas,
                                                            int pullReplicas,
                                                            List<String> nodesList)

Deprecated.

#### getDiagnostics

    public static MapWriter getDiagnostics(Policy policy,
                                           SolrCloudManager cloudManager)

Deprecated.

#### getDiagnostics

    public static MapWriter getDiagnostics(Policy.Session session)

Deprecated.

#### getSuggestions

    public static List<Suggester.SuggestionInfo> getSuggestions(AutoScalingConfig autoScalingConf,
                                                                SolrCloudManager cloudManager,
                                                                SolrParams params)

Deprecated.

#### getSuggestions

    public static List<Suggester.SuggestionInfo> getSuggestions(AutoScalingConfig autoScalingConf,
                                                                SolrCloudManager cloudManager)

Deprecated.

#### getSuggestions

    public static List<Suggester.SuggestionInfo> getSuggestions(AutoScalingConfig autoScalingConf,
                                                                SolrCloudManager cloudManager,
                                                                int max,
                                                                int timeoutInSecs,
                                                                SolrParams params)

Deprecated.

#### logState

    public static void logState(SolrCloudManager cloudManager,
                                Suggester suggester)

Deprecated.
Use this to dump the state of a system and to generate a testcase

#### getSession

    public static PolicyHelper.SessionWrapper getSession(SolrCloudManager cloudManager)
                                                  throws IOException,
                                                         InterruptedException

Deprecated.
How to get a shared Policy Session 1) call `getSession(SolrCloudManager)` 2) compute all suggestions 3) call `PolicyHelper.SessionWrapper.returnSession(Policy.Session)` 4) perform all suggestions 5) call `PolicyHelper.SessionWrapper.release()`

Throws:
  `IOException`
  `InterruptedException`

#### getLastSessionWrapper

    public static PolicyHelper.SessionWrapper getLastSessionWrapper(boolean clear)

Deprecated.
Use this to get the last used session wrapper in this thread

Parameters:
  `clear` - whether to unset the threadlocal or not