Class ScriptClusterSelectorImpl
java.lang.Object
com.netflix.genie.web.selectors.impl.ScriptClusterSelectorImpl
- All Implemented Interfaces:
ClusterSelector
,ResourceSelector<Cluster,
ClusterSelectionContext>
An implementation of the
ClusterSelector
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
ConstructorDescriptionScriptClusterSelectorImpl
(ClusterSelectorManagedScript clusterSelectorManagedScript, io.micrometer.core.instrument.MeterRegistry registry) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionselect
(@Valid ClusterSelectionContext context) Select a resource from the given set of resources if possible.
-
Constructor Details
-
ScriptClusterSelectorImpl
public ScriptClusterSelectorImpl(ClusterSelectorManagedScript clusterSelectorManagedScript, io.micrometer.core.instrument.MeterRegistry registry) Constructor.- Parameters:
clusterSelectorManagedScript
- the cluster selector scriptregistry
- the metrics registry
-
-
Method Details
-
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
-