Class PolicyHelper
- java.lang.Object
-
- org.apache.solr.client.solrj.cloud.autoscaling.PolicyHelper
-
public class PolicyHelper extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPolicyHelper.SessionWrapperstatic classPolicyHelper.Status
-
Field Summary
Fields Modifier and Type Field Description static intSESSION_EXPIRY
-
Constructor Summary
Constructors Constructor Description PolicyHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MapWritergetDiagnostics(Policy.Session session)static MapWritergetDiagnostics(Policy policy, SolrCloudManager cloudManager)static PolicyHelper.SessionWrappergetLastSessionWrapper(boolean clear)Use this to get the last used session wrapper in this threadstatic 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)static PolicyHelper.SessionWrappergetSession(SolrCloudManager cloudManager)How to get a shared Policy Session 1) callgetSession(SolrCloudManager)2) compute all suggestions 3) callPolicyHelper.SessionWrapper.returnSession(Policy.Session)4) perform all suggestions 5) callPolicyHelper.SessionWrapper.release()static List<Suggester.SuggestionInfo>getSuggestions(AutoScalingConfig autoScalingConf, SolrCloudManager cloudManager)static List<Suggester.SuggestionInfo>getSuggestions(AutoScalingConfig autoScalingConf, SolrCloudManager cloudManager, int max, int timeoutInSecs)static voidlogState(SolrCloudManager cloudManager, Suggester suggester)Use this to dump the state of a system and to generate a testcase
-
-
-
Field Detail
-
SESSION_EXPIRY
public static final int SESSION_EXPIRY
- See Also:
- Constant Field Values
-
-
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)
-
getDiagnostics
public static MapWriter getDiagnostics(Policy policy, SolrCloudManager cloudManager)
-
getDiagnostics
public static MapWriter getDiagnostics(Policy.Session session)
-
getSuggestions
public static List<Suggester.SuggestionInfo> getSuggestions(AutoScalingConfig autoScalingConf, SolrCloudManager cloudManager)
-
getSuggestions
public static List<Suggester.SuggestionInfo> getSuggestions(AutoScalingConfig autoScalingConf, SolrCloudManager cloudManager, int max, int timeoutInSecs)
-
logState
public static void logState(SolrCloudManager cloudManager, Suggester suggester)
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
How to get a shared Policy Session 1) callgetSession(SolrCloudManager)2) compute all suggestions 3) callPolicyHelper.SessionWrapper.returnSession(Policy.Session)4) perform all suggestions 5) callPolicyHelper.SessionWrapper.release()- Throws:
IOExceptionInterruptedException
-
getLastSessionWrapper
public static PolicyHelper.SessionWrapper getLastSessionWrapper(boolean clear)
Use this to get the last used session wrapper in this thread- Parameters:
clear- whether to unset the threadlocal or not
-
-