Class IndexSizeTrigger
- java.lang.Object
-
- org.apache.solr.cloud.autoscaling.TriggerBase
-
- org.apache.solr.cloud.autoscaling.IndexSizeTrigger
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Runnable,AutoScaling.Trigger
public class IndexSizeTrigger extends TriggerBase
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIndexSizeTrigger.IndexSizeEventstatic classIndexSizeTrigger.Unit
-
Field Summary
Fields Modifier and Type Field Description static StringABOVE_BYTES_PROPstatic StringABOVE_DOCS_PROPstatic StringABOVE_OP_PROPstatic StringABOVE_SIZE_KEYstatic StringBELOW_BYTES_PROPstatic StringBELOW_DOCS_PROPstatic StringBELOW_OP_PROPstatic StringBELOW_SIZE_KEYstatic StringBYTES_SIZE_KEYstatic StringCOLLECTIONS_PROPstatic StringCOMMIT_SIZE_KEYstatic intDEFAULT_MAX_OPSstatic StringDOCS_SIZE_KEYstatic StringMAX_DOC_KEYstatic StringMAX_OPS_PROPstatic StringSPLIT_BY_PREFIXstatic StringSPLIT_FUZZ_PROPstatic StringSPLIT_METHOD_PROPstatic StringTOTAL_BYTES_SIZE_KEYstatic StringVIOLATION_KEY-
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 IndexSizeTrigger(String name)
-
Method Summary
All Methods Static 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.static longestimatedSize(long maxDoc, long numDocs, long commitSize)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
-
ABOVE_BYTES_PROP
public static final String ABOVE_BYTES_PROP
- See Also:
- Constant Field Values
-
ABOVE_DOCS_PROP
public static final String ABOVE_DOCS_PROP
- See Also:
- Constant Field Values
-
ABOVE_OP_PROP
public static final String ABOVE_OP_PROP
- See Also:
- Constant Field Values
-
BELOW_BYTES_PROP
public static final String BELOW_BYTES_PROP
- See Also:
- Constant Field Values
-
BELOW_DOCS_PROP
public static final String BELOW_DOCS_PROP
- See Also:
- Constant Field Values
-
BELOW_OP_PROP
public static final String BELOW_OP_PROP
- See Also:
- Constant Field Values
-
COLLECTIONS_PROP
public static final String COLLECTIONS_PROP
- See Also:
- Constant Field Values
-
MAX_OPS_PROP
public static final String MAX_OPS_PROP
- See Also:
- Constant Field Values
-
SPLIT_FUZZ_PROP
public static final String SPLIT_FUZZ_PROP
- See Also:
- Constant Field Values
-
SPLIT_METHOD_PROP
public static final String SPLIT_METHOD_PROP
- See Also:
- Constant Field Values
-
SPLIT_BY_PREFIX
public static final String SPLIT_BY_PREFIX
- See Also:
- Constant Field Values
-
BYTES_SIZE_KEY
public static final String BYTES_SIZE_KEY
- See Also:
- Constant Field Values
-
TOTAL_BYTES_SIZE_KEY
public static final String TOTAL_BYTES_SIZE_KEY
- See Also:
- Constant Field Values
-
DOCS_SIZE_KEY
public static final String DOCS_SIZE_KEY
- See Also:
- Constant Field Values
-
MAX_DOC_KEY
public static final String MAX_DOC_KEY
- See Also:
- Constant Field Values
-
COMMIT_SIZE_KEY
public static final String COMMIT_SIZE_KEY
- See Also:
- Constant Field Values
-
ABOVE_SIZE_KEY
public static final String ABOVE_SIZE_KEY
- See Also:
- Constant Field Values
-
BELOW_SIZE_KEY
public static final String BELOW_SIZE_KEY
- See Also:
- Constant Field Values
-
VIOLATION_KEY
public static final String VIOLATION_KEY
- See Also:
- Constant Field Values
-
DEFAULT_MAX_OPS
public static final int DEFAULT_MAX_OPS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IndexSizeTrigger
public IndexSizeTrigger(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()
-
estimatedSize
public static long estimatedSize(long maxDoc, long numDocs, long commitSize)
-
-