Package com.netflix.genie.web.scripts
Class AgentLauncherSelectorManagedScript
java.lang.Object
com.netflix.genie.web.scripts.ManagedScript
com.netflix.genie.web.scripts.ResourceSelectorScript<AgentLauncher,AgentLauncherSelectionContext>
com.netflix.genie.web.scripts.AgentLauncherSelectorManagedScript
public class AgentLauncherSelectorManagedScript
extends ResourceSelectorScript<AgentLauncher,AgentLauncherSelectionContext>
Extension of
ResourceSelectorScript
that delegates selection of a job's agent launcher when more than one
choice is available. See also: AgentLauncherSelector
.- Since:
- 4.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionAgentLauncherSelectorManagedScript
(ScriptManager scriptManager, AgentLauncherSelectorScriptProperties properties, io.micrometer.core.instrument.MeterRegistry registry, PropertiesMapCache propertyMapCache) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addParametersForScript
(Map<String, Object> parameters, AgentLauncherSelectionContext context) Add any implementation specific parameters to the map of parameters to send to the script.Given theJobRequest
and an associated set of resources which matched the request criteria invoke the configured script to see if a preferred resource is selected based on the current logic.Methods inherited from class com.netflix.genie.web.scripts.ManagedScript
evaluateScript, warmUp
-
Constructor Details
-
AgentLauncherSelectorManagedScript
public AgentLauncherSelectorManagedScript(ScriptManager scriptManager, AgentLauncherSelectorScriptProperties properties, io.micrometer.core.instrument.MeterRegistry registry, PropertiesMapCache propertyMapCache) Constructor.- Parameters:
scriptManager
- script managerproperties
- script manager propertiesregistry
- meter registrypropertyMapCache
- dynamic properties map cache
-
-
Method Details
-
selectResource
public ResourceSelectorScriptResult<AgentLauncher> selectResource(AgentLauncherSelectionContext context) throws ResourceSelectionException Given theJobRequest
and an associated set of resources which matched the request criteria invoke the configured script to see if a preferred resource is selected based on the current logic.- Overrides:
selectResource
in classResourceSelectorScript<AgentLauncher,
AgentLauncherSelectionContext> - Parameters:
context
- TheResourceSelectionContext
instance containing information about the context for this selection- Returns:
- A
ResourceSelectorScriptResult
instance - Throws:
ResourceSelectionException
- If an unexpected error occurs during selection
-
addParametersForScript
protected void addParametersForScript(Map<String, Object> parameters, AgentLauncherSelectionContext context) Add any implementation specific parameters to the map of parameters to send to the script.- Overrides:
addParametersForScript
in classResourceSelectorScript<AgentLauncher,
AgentLauncherSelectionContext> - Parameters:
parameters
- The existing set of parameters for implementations to add tocontext
- The selection context
-