Each of the SolrCloud Autoscaling triggers have default aboveOp/belowOp actions, but in some cases, the trigger is becoming too tightly coupled with its associated actions. This could be considered an abstraction violation, as the trigger's compute and execute actions should be separate from the trigger itself.
My proposal is to separate all action-specific configs out of the existing triggers, and instead do the following:
- Require that all trigger actions have a Validator, which ensures that the properties map contains valid values
- During trigger configuration, pass in a properties map (essentially a JSON blob), an action name, and its associated validator
- Run the validator against the given properties to ensure that the trigger can run without encountering exceptions
For example, we would make the IndexSizeTrigger action-agnostic, and remove all shard split parameters from the trigger. When we configure the trigger, we could instead pass in the desired action (e.g. shard split), the parameters for that action (e.g. splitByPrefix, splitFuzz, etc.) in a map, and a validator for that action (e.g. code to ensure that the parameters passed in have valid values; such checks are currently hard-coded into the trigger configuration).