public class ScheduledTriggers extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ACTION_THROTTLE_PERIOD_SECONDS |
static int |
DEFAULT_COOLDOWN_PERIOD_SECONDS |
static int |
DEFAULT_SCHEDULED_TRIGGER_DELAY_SECONDS |
static int |
DEFAULT_TRIGGER_CORE_POOL_SIZE |
protected static Random |
RANDOM |
Constructor and Description |
---|
ScheduledTriggers(SolrResourceLoader loader,
SolrCloudManager cloudManager) |
Modifier and Type | Method and Description |
---|---|
void |
add(AutoScaling.Trigger newTrigger)
Adds a new trigger or replaces an existing one.
|
void |
addAdditionalListener(TriggerListener listener)
Add a temporary listener for internal use (tests, simulation).
|
void |
close() |
Set<String> |
getScheduledTriggerNames() |
AutoScaling.Trigger |
getTrigger(String name)
For use in white/grey box testing: The Trigger returned may be inspected,
but should not be modified in any way.
|
void |
pauseTriggers()
Pauses all scheduled trigger invocations without interrupting any that are in progress
|
void |
remove(String triggerName)
Removes and stops the trigger with the given name.
|
void |
removeAdditionalListener(TriggerListener listener)
Remove a temporary listener for internal use (tests, simulation).
|
void |
removeAll()
Remove and stop all triggers.
|
void |
resumeTriggers(long afterDelayMillis)
Resumes all previously cancelled triggers to be scheduled after the given initial delay
|
void |
setAutoScalingConfig(AutoScalingConfig autoScalingConfig)
Set the current autoscaling config.
|
public static final int DEFAULT_SCHEDULED_TRIGGER_DELAY_SECONDS
public static final int DEFAULT_ACTION_THROTTLE_PERIOD_SECONDS
public static final int DEFAULT_COOLDOWN_PERIOD_SECONDS
public static final int DEFAULT_TRIGGER_CORE_POOL_SIZE
protected static final Random RANDOM
public ScheduledTriggers(SolrResourceLoader loader, SolrCloudManager cloudManager)
public void setAutoScalingConfig(AutoScalingConfig autoScalingConfig)
OverseerTriggerThread
when autoscaling.json is updated,
and it re-initializes trigger listeners and other properties used by the frameworkautoScalingConfig
- current autoscaling.jsonpublic void add(AutoScaling.Trigger newTrigger) throws Exception
newTrigger
- the trigger to be managedAlreadyClosedException
- if this class has already been closedException
public void pauseTriggers()
public void resumeTriggers(long afterDelayMillis)
afterDelayMillis
- the initial delay in milliseconds after which triggers should be resumedpublic void removeAll()
public void remove(String triggerName)
triggerName
- the name of the trigger to be removedpublic Set<String> getScheduledTriggerNames()
public AutoScaling.Trigger getTrigger(String name)
name
- the name of an existing triggerpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void addAdditionalListener(TriggerListener listener)
listener
- listener instancepublic void removeAdditionalListener(TriggerListener listener)
listener
- listener instanceCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.