Package com.netflix.genie.web.scripts
Class CommandSelectorManagedScript
java.lang.Object
com.netflix.genie.web.scripts.ManagedScript
com.netflix.genie.web.scripts.ResourceSelectorScript<com.netflix.genie.common.internal.dtos.Command,CommandSelectionContext>
com.netflix.genie.web.scripts.CommandSelectorManagedScript
public class CommandSelectorManagedScript
extends ResourceSelectorScript<com.netflix.genie.common.internal.dtos.Command,CommandSelectionContext>
An extension of
ResourceSelectorScript which from a set of commands and the original job request will
attempt to determine the best command to use for execution.- Since:
- 4.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionCommandSelectorManagedScript(ScriptManager scriptManager, CommandSelectorManagedScriptProperties properties, io.micrometer.core.instrument.MeterRegistry registry, com.netflix.genie.common.internal.util.PropertiesMapCache propertyMapCache) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddParametersForScript(Map<String, Object> parameters, CommandSelectionContext context) Add any implementation specific parameters to the map of parameters to send to the script.ResourceSelectorScriptResult<com.netflix.genie.common.internal.dtos.Command>selectResource(CommandSelectionContext context) Given theJobRequestand 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
-
CommandSelectorManagedScript
public CommandSelectorManagedScript(ScriptManager scriptManager, CommandSelectorManagedScriptProperties properties, io.micrometer.core.instrument.MeterRegistry registry, com.netflix.genie.common.internal.util.PropertiesMapCache propertyMapCache) Constructor.- Parameters:
scriptManager- TheScriptManagerinstance to useproperties- TheCommandSelectorManagedScriptPropertiesinstance to useregistry- TheMeterRegistryinstance to usepropertyMapCache- ThePropertiesMapCacheinstance to use
-
-
Method Details
-
selectResource
public ResourceSelectorScriptResult<com.netflix.genie.common.internal.dtos.Command> selectResource(CommandSelectionContext context) throws ResourceSelectionException Given theJobRequestand 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:
selectResourcein classResourceSelectorScript<com.netflix.genie.common.internal.dtos.Command,CommandSelectionContext> - Parameters:
context- TheResourceSelectionContextinstance containing information about the context for this selection- Returns:
- A
ResourceSelectorScriptResultinstance - Throws:
ResourceSelectionException- If an unexpected error occurs during selection
-
addParametersForScript
protected void addParametersForScript(Map<String, Object> parameters, CommandSelectionContext context) Add any implementation specific parameters to the map of parameters to send to the script.- Overrides:
addParametersForScriptin classResourceSelectorScript<com.netflix.genie.common.internal.dtos.Command,CommandSelectionContext> - Parameters:
parameters- The existing set of parameters for implementations to add tocontext- The selection context
-