Class SearchRateTrigger
- java.lang.Object
-
- org.apache.solr.cloud.autoscaling.TriggerBase
-
- org.apache.solr.cloud.autoscaling.SearchRateTrigger
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Runnable,AutoScaling.Trigger
public class SearchRateTrigger extends TriggerBase
Trigger for theTriggerEventType.SEARCHRATEevent.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSearchRateTrigger.SearchRateEvent
-
Field Summary
Fields Modifier and Type Field Description static StringABOVE_NODE_OP_PROPstatic StringABOVE_NODE_RATE_PROPstatic StringABOVE_OP_PROPstatic StringABOVE_RATE_PROPstatic StringBC_COLLECTION_PROPstatic StringBC_RATE_PROPstatic StringBELOW_NODE_OP_PROPstatic StringBELOW_NODE_RATE_PROPstatic StringBELOW_OP_PROPstatic StringBELOW_RATE_PROPstatic StringCOLD_COLLECTIONSstatic StringCOLD_NODESstatic StringCOLD_REPLICASstatic StringCOLD_SHARDSstatic StringCOLLECTIONS_PROPstatic intDEFAULT_MAX_OPSstatic StringDEFAULT_METRICstatic StringHOT_COLLECTIONSstatic StringHOT_NODESstatic StringHOT_REPLICASstatic StringHOT_SHARDSstatic StringMAX_OPS_PROPstatic StringMETRIC_PROPstatic StringMIN_REPLICAS_PROPstatic StringVIOLATION_PROP-
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 SearchRateTrigger(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, getRequiredProperties, getValidProperties, getWaitForSecond, hashCode, init, isClosed, isEnabled, restoreState, saveState, setProcessor
-
-
-
-
Field Detail
-
COLLECTIONS_PROP
public static final String COLLECTIONS_PROP
- See Also:
- Constant Field Values
-
METRIC_PROP
public static final String METRIC_PROP
- See Also:
- Constant Field Values
-
MAX_OPS_PROP
public static final String MAX_OPS_PROP
- See Also:
- Constant Field Values
-
MIN_REPLICAS_PROP
public static final String MIN_REPLICAS_PROP
- See Also:
- Constant Field Values
-
ABOVE_RATE_PROP
public static final String ABOVE_RATE_PROP
- See Also:
- Constant Field Values
-
BELOW_RATE_PROP
public static final String BELOW_RATE_PROP
- See Also:
- Constant Field Values
-
ABOVE_NODE_RATE_PROP
public static final String ABOVE_NODE_RATE_PROP
- See Also:
- Constant Field Values
-
BELOW_NODE_RATE_PROP
public static final String BELOW_NODE_RATE_PROP
- See Also:
- Constant Field Values
-
ABOVE_OP_PROP
public static final String ABOVE_OP_PROP
- See Also:
- Constant Field Values
-
BELOW_OP_PROP
public static final String BELOW_OP_PROP
- See Also:
- Constant Field Values
-
ABOVE_NODE_OP_PROP
public static final String ABOVE_NODE_OP_PROP
- See Also:
- Constant Field Values
-
BELOW_NODE_OP_PROP
public static final String BELOW_NODE_OP_PROP
- See Also:
- Constant Field Values
-
BC_COLLECTION_PROP
public static final String BC_COLLECTION_PROP
- See Also:
- Constant Field Values
-
BC_RATE_PROP
public static final String BC_RATE_PROP
- See Also:
- Constant Field Values
-
HOT_NODES
public static final String HOT_NODES
- See Also:
- Constant Field Values
-
HOT_COLLECTIONS
public static final String HOT_COLLECTIONS
- See Also:
- Constant Field Values
-
HOT_SHARDS
public static final String HOT_SHARDS
- See Also:
- Constant Field Values
-
HOT_REPLICAS
public static final String HOT_REPLICAS
- See Also:
- Constant Field Values
-
COLD_NODES
public static final String COLD_NODES
- See Also:
- Constant Field Values
-
COLD_COLLECTIONS
public static final String COLD_COLLECTIONS
- See Also:
- Constant Field Values
-
COLD_SHARDS
public static final String COLD_SHARDS
- See Also:
- Constant Field Values
-
COLD_REPLICAS
public static final String COLD_REPLICAS
- See Also:
- Constant Field Values
-
VIOLATION_PROP
public static final String VIOLATION_PROP
- See Also:
- Constant Field Values
-
DEFAULT_MAX_OPS
public static final int DEFAULT_MAX_OPS
- See Also:
- Constant Field Values
-
DEFAULT_METRIC
public static final String DEFAULT_METRIC
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SearchRateTrigger
public SearchRateTrigger(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()
-
-