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
Modifier and TypeFieldDescriptionstatic final int
The relative order of theScriptClusterSelectorImpl
if one is enabled relative to otherClusterSelector
instances that may be in the context. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionagentLauncherSelector
(Optional<AgentLauncherSelectorManagedScript> agentLauncherSelectorManagedScript, @NotEmpty Collection<AgentLauncher> agentLaunchers, io.micrometer.core.instrument.MeterRegistry registry) Provide a defaultAgentLauncherSelector
implementation if no other has been defined in the context.commandSelector
(Optional<CommandSelectorManagedScript> commandSelectorManagedScriptOptional, io.micrometer.core.instrument.MeterRegistry registry) Provide a defaultCommandSelector
implementation 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 theScriptClusterSelectorImpl
instance 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 theScriptClusterSelectorImpl
if one is enabled relative to otherClusterSelector
instances 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 theScriptClusterSelectorImpl
instance 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
RandomClusterSelectorImpl
instance
-
commandSelector
@Bean @ConditionalOnMissingBean(CommandSelector.class) public CommandSelector commandSelector(Optional<CommandSelectorManagedScript> commandSelectorManagedScriptOptional, io.micrometer.core.instrument.MeterRegistry registry) Provide a defaultCommandSelector
implementation if no other has been defined in the context already.- Parameters:
commandSelectorManagedScriptOptional
- AnOptional
wrapping aCommandSelectorManagedScript
instance if one is present in the context elseOptional.empty()
registry
- TheMeterRegistry
instance to use- Returns:
- A
ScriptCommandSelectorImpl
if aCommandSelectorManagedScript
instance as present else aRandomCommandSelectorImpl
instance
-
agentLauncherSelector
@Bean @ConditionalOnMissingBean(AgentLauncherSelector.class) public AgentLauncherSelector agentLauncherSelector(Optional<AgentLauncherSelectorManagedScript> agentLauncherSelectorManagedScript, @NotEmpty @NotEmpty Collection<AgentLauncher> agentLaunchers, io.micrometer.core.instrument.MeterRegistry registry) Provide a defaultAgentLauncherSelector
implementation if no other has been defined in the context.- Parameters:
agentLauncherSelectorManagedScript
- AnOptional
AgentLauncherSelectorManagedScript
instance if one is present in the contextagentLaunchers
- The available agent launchersregistry
- TheMeterRegistry
instance to use- Returns:
- A
ScriptAgentLauncherSelectorImpl
if aAgentLauncherSelectorManagedScript
instance is present, else aRandomAgentLauncherSelectorImpl
instance
-