public class ClusterSelectorManagedScript extends ResourceSelectorScript<com.netflix.genie.common.external.dtos.v4.Cluster,ClusterSelectionContext>
ResourceSelectorScript that delegates selection of a job's cluster when more than one choice is
available. See also: ClusterSelector.
The contract between the script and the Java code is that the script will be supplied global variables
clusters and jobRequest which will be a Set of Cluster instances
matching the cluster criteria and the job request that kicked off this evaluation respectively. The code expects the
script to return a ResourceSelectorScriptResult instance.
| Constructor and Description |
|---|
ClusterSelectorManagedScript(ScriptManager scriptManager,
ClusterSelectorScriptProperties properties,
io.micrometer.core.instrument.MeterRegistry registry)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addParametersForScript(java.util.Map<java.lang.String,java.lang.Object> parameters,
ClusterSelectionContext context)
Add any implementation specific parameters to the map of parameters to send to the script.
|
ResourceSelectorScriptResult<com.netflix.genie.common.external.dtos.v4.Cluster> |
selectResource(ClusterSelectionContext context)
Given the
JobRequest 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. |
evaluateScript, warmUppublic ClusterSelectorManagedScript(ScriptManager scriptManager, ClusterSelectorScriptProperties properties, io.micrometer.core.instrument.MeterRegistry registry)
scriptManager - script managerproperties - script manager propertiesregistry - meter registrypublic ResourceSelectorScriptResult<com.netflix.genie.common.external.dtos.v4.Cluster> selectResource(ClusterSelectionContext context) throws ResourceSelectionException
JobRequest 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.selectResource in class ResourceSelectorScript<com.netflix.genie.common.external.dtos.v4.Cluster,ClusterSelectionContext>context - The ResourceSelectionContext instance containing information about the context for this
selectionResourceSelectorScriptResult instanceResourceSelectionException - If an unexpected error occurs during selectionprotected void addParametersForScript(java.util.Map<java.lang.String,java.lang.Object> parameters,
ClusterSelectionContext context)
addParametersForScript in class ResourceSelectorScript<com.netflix.genie.common.external.dtos.v4.Cluster,ClusterSelectionContext>parameters - The existing set of parameters for implementations to add tocontext - The selection context