Class SelectorsAutoConfiguration
java.lang.Object
com.netflix.genie.web.spring.autoconfigure.selectors.SelectorsAutoConfiguration
Spring Auto Configuration for the selectors module.
- Since:
- 4.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe relative order of theScriptClusterSelectorImplif one is enabled relative to otherClusterSelectorinstances that may be in the context. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionagentLauncherSelector(Optional<AgentLauncherSelectorManagedScript> agentLauncherSelectorManagedScript, @NotEmpty Collection<AgentLauncher> agentLaunchers, io.micrometer.core.instrument.MeterRegistry registry) Provide a defaultAgentLauncherSelectorimplementation if no other has been defined in the context.commandSelector(Optional<CommandSelectorManagedScript> commandSelectorManagedScriptOptional, io.micrometer.core.instrument.MeterRegistry registry) Provide a defaultCommandSelectorimplementation if no other has been defined in the context already.The default cluster selector if all others fail.scriptClusterSelector(ClusterSelectorManagedScript clusterSelectorManagedScript, io.micrometer.core.instrument.MeterRegistry registry) Produce theScriptClusterSelectorImplinstance to use for this Genie node if it was configured by the user.
-
Field Details
-
SCRIPT_CLUSTER_SELECTOR_PRECEDENCE
public static final int SCRIPT_CLUSTER_SELECTOR_PRECEDENCEThe relative order of theScriptClusterSelectorImplif one is enabled relative to otherClusterSelectorinstances that may be in the context. This allows users to fit 50 more selectors between the script selector and the defaultRandomClusterSelectorImpl. If the user wants to place a selector implementation before the script one they only need to subtract from this value.- See Also:
-
-
Constructor Details
-
SelectorsAutoConfiguration
public SelectorsAutoConfiguration()
-
-
Method Details
-
scriptClusterSelector
@Bean @Order(2147483597) @ConditionalOnBean(ClusterSelectorManagedScript.class) public ScriptClusterSelectorImpl scriptClusterSelector(ClusterSelectorManagedScript clusterSelectorManagedScript, io.micrometer.core.instrument.MeterRegistry registry) Produce theScriptClusterSelectorImplinstance to use for this Genie node if it was configured by the user. This bean is only created if the script is configured.- Parameters:
clusterSelectorManagedScript- the cluster selector scriptregistry- the metrics registry- Returns:
- a
ScriptClusterSelectorImpl
-
randomizedClusterSelector
The default cluster selector if all others fail.Defaults to
Ordered.LOWEST_PRECEDENCE.- Returns:
- A
RandomClusterSelectorImplinstance
-
commandSelector
@Bean @ConditionalOnMissingBean(CommandSelector.class) public CommandSelector commandSelector(Optional<CommandSelectorManagedScript> commandSelectorManagedScriptOptional, io.micrometer.core.instrument.MeterRegistry registry) Provide a defaultCommandSelectorimplementation if no other has been defined in the context already.- Parameters:
commandSelectorManagedScriptOptional- AnOptionalwrapping aCommandSelectorManagedScriptinstance if one is present in the context elseOptional.empty()registry- TheMeterRegistryinstance to use- Returns:
- A
ScriptCommandSelectorImplif aCommandSelectorManagedScriptinstance as present else aRandomCommandSelectorImplinstance
-
agentLauncherSelector
@Bean @ConditionalOnMissingBean(AgentLauncherSelector.class) public AgentLauncherSelector agentLauncherSelector(Optional<AgentLauncherSelectorManagedScript> agentLauncherSelectorManagedScript, @NotEmpty @NotEmpty Collection<AgentLauncher> agentLaunchers, io.micrometer.core.instrument.MeterRegistry registry) Provide a defaultAgentLauncherSelectorimplementation if no other has been defined in the context.- Parameters:
agentLauncherSelectorManagedScript- AnOptionalAgentLauncherSelectorManagedScriptinstance if one is present in the contextagentLaunchers- The available agent launchersregistry- TheMeterRegistryinstance to use- Returns:
- A
ScriptAgentLauncherSelectorImplif aAgentLauncherSelectorManagedScriptinstance is present, else aRandomAgentLauncherSelectorImplinstance
-