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 class
IndexSizeTrigger.IndexSizeEvent
static class
IndexSizeTrigger.Unit
-
Field Summary
Fields Modifier and Type Field Description static String
ABOVE_BYTES_PROP
static String
ABOVE_DOCS_PROP
static String
ABOVE_OP_PROP
static String
ABOVE_SIZE_KEY
static String
BELOW_BYTES_PROP
static String
BELOW_DOCS_PROP
static String
BELOW_OP_PROP
static String
BELOW_SIZE_KEY
static String
BYTES_SIZE_KEY
static String
COLLECTIONS_PROP
static String
COMMIT_SIZE_KEY
static int
DEFAULT_MAX_OPS
static String
DOCS_SIZE_KEY
static String
MAX_DOC_KEY
static String
MAX_OPS_PROP
static String
SPLIT_BY_PREFIX
static String
SPLIT_FUZZ_PROP
static String
SPLIT_METHOD_PROP
static String
TOTAL_BYTES_SIZE_KEY
static String
VIOLATION_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 void
configure(SolrResourceLoader loader, SolrCloudManager cloudManager, Map<String,Object> properties)
Called when trigger is created but before it's initialized or scheduled for use.static long
estimatedSize(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.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, 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.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.
-
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.
-
restoreState
public void restoreState(AutoScaling.Trigger old)
Description copied from interface:AutoScaling.Trigger
Set internal state of this trigger from another instance.
-
run
public void run()
-
estimatedSize
public static long estimatedSize(long maxDoc, long numDocs, long commitSize)
-
-