Class NodeLostTrigger
- java.lang.Object
-
- org.apache.solr.cloud.autoscaling.TriggerBase
-
- org.apache.solr.cloud.autoscaling.NodeLostTrigger
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Runnable
,AutoScaling.Trigger
public class NodeLostTrigger extends TriggerBase
Trigger for theTriggerEventType.NODELOST
event
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NodeLostTrigger.NodeLostEvent
-
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 NodeLostTrigger(String name)
-
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 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.void
init()
Called before a trigger is scheduled.void
restoreState(AutoScaling.Trigger old)
Set internal state of this trigger from another instance.void
run()
protected void
setState(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, getRequiredProperties, getValidProperties, getWaitForSecond, hashCode, isClosed, isEnabled, restoreState, saveState, setProcessor
-
-
-
-
Constructor Detail
-
NodeLostTrigger
public NodeLostTrigger(String name)
-
-
Method Detail
-
init
public void init() throws Exception
Description copied from interface:AutoScaling.Trigger
Called 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:
init
in interfaceAutoScaling.Trigger
- Overrides:
init
in classTriggerBase
- Throws:
Exception
-
configure
public void configure(SolrResourceLoader loader, SolrCloudManager cloudManager, Map<String,Object> properties) throws TriggerValidationException
Description copied from interface:AutoScaling.Trigger
Called 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:
configure
in interfaceAutoScaling.Trigger
- Overrides:
configure
in classTriggerBase
properties
- configuration properties- Throws:
TriggerValidationException
- contains details of invalid configuration parameters.
-
restoreState
public void restoreState(AutoScaling.Trigger old)
Description copied from interface:AutoScaling.Trigger
Set internal state of this trigger from another instance.
-
getState
protected Map<String,Object> getState()
Description copied from class:TriggerBase
Prepare and return internal state of this trigger in a format suitable for persisting in ZK.- Specified by:
getState
in 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:TriggerBase
Restore internal state of this trigger from properties retrieved from ZK.- Specified by:
setState
in classTriggerBase
- Parameters:
state
- never null but may be empty.
-
run
public void run()
-
-