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 forTriggerAction
implementations.
-
-
Field Summary
Fields Modifier and Type Field Description protected SolrCloudManager
cloudManager
protected SolrResourceLoader
loader
protected Map<String,Object>
properties
protected Set<String>
requiredProperties
Set of required property names.protected Set<String>
validProperties
Set of valid property names.
-
Constructor Summary
Constructors Modifier Constructor Description protected
TriggerActionBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
configure(SolrResourceLoader loader, SolrCloudManager cloudManager, Map<String,Object> properties)
Called when action is created but before it's initialized and used.String
getName()
void
init()
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:
getName
in interfaceTriggerAction
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
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
- 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 Exception
Description copied from interface:TriggerAction
Called 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:
init
in interfaceTriggerAction
- Throws:
Exception
-
-