Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Implement set-trigger and remove-trigger API to add, update and remove triggers for autoscaling.
The following events are supported:
- nodeAdded
- nodeLost
- replicaLost
- schedule
- searchRate
- indexRate
Each trigger has the following properties:
- ‘name’ - a unique string to identify the trigger so that it can be read, updated or removed later
- ‘state’ - the state of the event (ENABLED or DISABLED), default is ENABLED. This allows one to add a trigger which is disabled until a RESUME_TRIGGER API is called.
- ‘actions’ - a list of actions to be performed in the order specified. The default list of actions for every trigger are to compute the plan, execute the plan and save the plan. If an empty list of actions is explicitly specified or null is specified when creating/updating the trigger then no actions are performed at all.
Here's an example of an API invocation:
{ "set-trigger" : { "name" : "node_lost_trigger", "event" : "nodeLost", "waitFor" : "10m", "state" : "ENABLED", "actions" : [ { "name" : "compute_plan", "class" : "solr.ComputePlanAction" }, { "name" : "execute_plan", "class" : "solr.ExecutePlanAction" }, { "name" : "log_plan", "class" : "solr.LogPlanAction", "collection" : ".system" } ] } }
Note this issue is only about implementation of the user-facing APIs and not the actual trigger mechanism itself.