Class NodeAddedTrigger
- java.lang.Object
-
- org.apache.solr.cloud.autoscaling.TriggerBase
-
- org.apache.solr.cloud.autoscaling.NodeAddedTrigger
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Runnable,AutoScaling.Trigger
public class NodeAddedTrigger extends TriggerBase
Trigger for theTriggerEventType.NODEADDEDevent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNodeAddedTrigger.NodeAddedEvent
-
Field Summary
-
Fields inherited from class org.apache.solr.cloud.autoscaling.TriggerBase
actions, cloudManager, enabled, eventType, isClosed, lastState, loader, name, processorRef, properties, requiredProperties, stateManager, validProperties, waitForSecond
-
-
Constructor Summary
Constructors Constructor Description NodeAddedTrigger(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(SolrResourceLoader loader, SolrCloudManager cloudManager, Map<String,Object> properties)Called when trigger is created but before it's initialized or scheduled for use.protected Map<String,Object>getState()Prepare and return internal state of this trigger in a format suitable for persisting in ZK.voidinit()Called before a trigger is scheduled.voidrestoreState(AutoScaling.Trigger old)Set internal state of this trigger from another instance.voidrun()protected voidsetState(Map<String,Object> state)Restore internal state of this trigger from properties retrieved from ZK.-
Methods inherited from class org.apache.solr.cloud.autoscaling.TriggerBase
close, deepCopyState, equals, getActions, getEventType, getName, getProcessor, getProperties, getWaitForSecond, hashCode, isClosed, isEnabled, restoreState, saveState, setProcessor
-
-
-
-
Constructor Detail
-
NodeAddedTrigger
public NodeAddedTrigger(String name)
-
-
Method Detail
-
init
public void init() throws ExceptionDescription copied from interface:AutoScaling.TriggerCalled before a trigger is scheduled. Any heavy object creation or initialisation should be done in this method instead of the Trigger's constructor.- Specified by:
initin interfaceAutoScaling.Trigger- Overrides:
initin classTriggerBase- Throws:
Exception
-
configure
public void configure(SolrResourceLoader loader, SolrCloudManager cloudManager, Map<String,Object> properties) throws TriggerValidationException
Description copied from interface:AutoScaling.TriggerCalled when trigger is created but before it's initialized or scheduled for use. This method should also verify that the trigger configuration parameters are correct. It may be called multiple times.- Specified by:
configurein interfaceAutoScaling.Trigger- Overrides:
configurein classTriggerBaseproperties- configuration properties- Throws:
TriggerValidationException- contains details of invalid configuration parameters.
-
restoreState
public void restoreState(AutoScaling.Trigger old)
Description copied from interface:AutoScaling.TriggerSet internal state of this trigger from another instance.
-
getState
protected Map<String,Object> getState()
Description copied from class:TriggerBasePrepare and return internal state of this trigger in a format suitable for persisting in ZK.- Specified by:
getStatein classTriggerBase- Returns:
- map of internal state properties. Note: values must be supported by
Utils.toJSON(Object).
-
setState
protected void setState(Map<String,Object> state)
Description copied from class:TriggerBaseRestore internal state of this trigger from properties retrieved from ZK.- Specified by:
setStatein classTriggerBase- Parameters:
state- never null but may be empty.
-
run
public void run()
-
-