Class TriggerActionBase
- java.lang.Object
-
- org.apache.solr.cloud.autoscaling.TriggerActionBase
-
- All Implemented Interfaces:
Closeable,AutoCloseable,TriggerAction
- Direct Known Subclasses:
ComputePlanAction,ExecutePlanAction,InactiveMarkersPlanAction,InactiveShardPlanAction
public abstract class TriggerActionBase extends Object implements TriggerAction
Base class forTriggerActionimplementations.
-
-
Field Summary
Fields Modifier and Type Field Description protected SolrCloudManagercloudManagerprotected SolrResourceLoaderloaderprotected Map<String,Object>propertiesprotected Set<String>requiredPropertiesSet of required property names.protected Set<String>validPropertiesSet of valid property names.
-
Constructor Summary
Constructors Modifier Constructor Description protectedTriggerActionBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidconfigure(SolrResourceLoader loader, SolrCloudManager cloudManager, Map<String,Object> properties)Called when action is created but before it's initialized and used.StringgetName()voidinit()Called before an action is first used.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.cloud.autoscaling.TriggerAction
process
-
-
-
-
Field Detail
-
loader
protected SolrResourceLoader loader
-
cloudManager
protected SolrCloudManager cloudManager
-
validProperties
protected final Set<String> validProperties
Set of valid property names. Subclasses may add to this set usingTriggerUtils.validProperties(Set, String...)
-
requiredProperties
protected final Set<String> requiredProperties
Set of required property names. Subclasses may add to this set usingTriggerUtils.requiredProperties(Set, Set, String...)(required properties are also valid properties).
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceTriggerAction
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
configure
public void configure(SolrResourceLoader loader, SolrCloudManager cloudManager, Map<String,Object> properties) throws TriggerValidationException
Description copied from interface:TriggerActionCalled 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:
configurein interfaceTriggerAction- Parameters:
loader- loader to use for instantiating sub-componentscloudManager- current instance of SolrCloudManagerproperties- configuration properties- Throws:
TriggerValidationException- contains details of invalid configuration parameters.
-
init
public void init() throws ExceptionDescription copied from interface:TriggerActionCalled before an action is first used. Any heavy object creation or initialization should be done in this method instead of the constructor orTriggerAction.configure(SolrResourceLoader, SolrCloudManager, Map)method.- Specified by:
initin interfaceTriggerAction- Throws:
Exception
-
-