Class MetricTrigger
- java.lang.Object
-
- org.apache.solr.cloud.autoscaling.TriggerBase
-
- org.apache.solr.cloud.autoscaling.MetricTrigger
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Runnable,AutoScaling.Trigger
public class MetricTrigger extends TriggerBase
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetricTrigger.MetricBreachedEvent
-
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 MetricTrigger(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.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, init, isClosed, isEnabled, restoreState, saveState, setProcessor
-
-
-
-
Constructor Detail
-
MetricTrigger
public MetricTrigger(String name)
-
-
Method Detail
-
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.
-
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.
-
restoreState
public void restoreState(AutoScaling.Trigger old)
Description copied from interface:AutoScaling.TriggerSet internal state of this trigger from another instance.
-
run
public void run()
-
-