Class ScriptClusterSelectorImpl
- java.lang.Object
-
- com.netflix.genie.web.selectors.impl.ScriptClusterSelectorImpl
-
- All Implemented Interfaces:
ClusterSelector
,ResourceSelector<Cluster,ClusterSelectionContext>
public class ScriptClusterSelectorImpl extends java.lang.Object implements ClusterSelector
An implementation of theClusterSelector
interface which uses user-provided script to make decisions based on the list of clusters and the job request supplied.- Since:
- 3.1.0
-
-
Constructor Summary
Constructors Constructor Description ScriptClusterSelectorImpl(ClusterSelectorManagedScript clusterSelectorManagedScript, io.micrometer.core.instrument.MeterRegistry registry)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceSelectionResult<Cluster>
select(@Valid ClusterSelectionContext context)
Select a resource from the given set of resources if possible.
-
-
-
Constructor Detail
-
ScriptClusterSelectorImpl
public ScriptClusterSelectorImpl(ClusterSelectorManagedScript clusterSelectorManagedScript, io.micrometer.core.instrument.MeterRegistry registry)
Constructor.- Parameters:
clusterSelectorManagedScript
- the cluster selector scriptregistry
- the metrics registry
-
-
Method Detail
-
select
public ResourceSelectionResult<Cluster> select(@Valid @Valid ClusterSelectionContext context) throws ResourceSelectionException
Select a resource from the given set of resources if possible.- Specified by:
select
in interfaceResourceSelector<Cluster,ClusterSelectionContext>
- Parameters:
context
- The context specific for this resource selection- Returns:
- The a
ResourceSelectionResult
instance which contains information about the result of this invocation - Throws:
ResourceSelectionException
- When the underlying implementation can't successfully come to a selection decision
-
-