Class ComputePlanAction
- java.lang.Object
-
- org.apache.solr.cloud.autoscaling.TriggerActionBase
-
- org.apache.solr.cloud.autoscaling.ComputePlanAction
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,TriggerAction
- Direct Known Subclasses:
AutoAddReplicasPlanAction
public class ComputePlanAction extends TriggerActionBase
This class is responsible for using the configured policy and preferences with the hints provided by the trigger event to compute the required cluster operations.The cluster operations computed here are put into the
ActionContext
's properties with the key name "operations". The value is a List of SolrRequest objects.
-
-
Field Summary
-
Fields inherited from class org.apache.solr.cloud.autoscaling.TriggerActionBase
cloudManager, loader, properties, requiredProperties, validProperties
-
-
Constructor Summary
Constructors Constructor Description ComputePlanAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(SolrResourceLoader loader, SolrCloudManager cloudManager, Map<String,Object> properties)
Called when action is created but before it's initialized and used.protected int
getMaxNumOps(TriggerEvent event, AutoScalingConfig autoScalingConfig, ClusterState clusterState)
protected int
getRequestedNumOps(TriggerEvent event)
protected Suggester
getSuggester(Policy.Session session, TriggerEvent event, ActionContext context, SolrCloudManager cloudManager)
void
process(TriggerEvent event, ActionContext context)
-
Methods inherited from class org.apache.solr.cloud.autoscaling.TriggerActionBase
close, getName, init
-
-
-
-
Method Detail
-
configure
public void configure(SolrResourceLoader loader, SolrCloudManager cloudManager, Map<String,Object> properties) throws TriggerValidationException
Description copied from interface:TriggerAction
Called when action is created but before it's initialized and used. This method should also verify that the configuration parameters are correct. It may be called multiple times.- Specified by:
configure
in interfaceTriggerAction
- Overrides:
configure
in classTriggerActionBase
- Parameters:
loader
- loader to use for instantiating sub-componentscloudManager
- current instance of SolrCloudManagerproperties
- configuration properties- Throws:
TriggerValidationException
- contains details of invalid configuration parameters.
-
process
public void process(TriggerEvent event, ActionContext context) throws Exception
- Throws:
Exception
-
getMaxNumOps
protected int getMaxNumOps(TriggerEvent event, AutoScalingConfig autoScalingConfig, ClusterState clusterState)
-
getRequestedNumOps
protected int getRequestedNumOps(TriggerEvent event)
-
getSuggester
protected Suggester getSuggester(Policy.Session session, TriggerEvent event, ActionContext context, SolrCloudManager cloudManager) throws IOException
- Throws:
IOException
-
-