Package com.netflix.genie.web.selectors
Class ClusterSelectionContext
- java.lang.Object
- 
- com.netflix.genie.web.selectors.ResourceSelectionContext<Cluster>
- 
- com.netflix.genie.web.selectors.ClusterSelectionContext
 
 
- 
 public class ClusterSelectionContext extends ResourceSelectionContext<Cluster> Extension ofResourceSelectionContextto include specific data useful in cluster selection.- Since:
- 4.0.0
 
- 
- 
Constructor SummaryConstructors Constructor Description ClusterSelectionContext(@NotEmpty java.lang.String jobId, @NotNull JobRequest jobRequest, boolean apiJob, @Valid Command command, @NotEmpty java.util.Set<@Valid Cluster> clusters)Constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<Command>getCommand()Get the command which was already selected for the job if there was one.java.util.Set<Cluster>getResources()Return theSetof distinct resources that a selector is meant to chose from.
 
- 
- 
- 
Constructor Detail- 
ClusterSelectionContextpublic ClusterSelectionContext(@NotEmpty @NotEmpty java.lang.String jobId, @NotNull @NotNull JobRequest jobRequest, boolean apiJob, @Nullable @Valid @Valid Command command, @NotEmpty @NotEmpty java.util.Set<@Valid Cluster> clusters)Constructor.- Parameters:
- jobId- The id of the job which the command is being selected for
- jobRequest- The job request the user originally made
- apiJob- Whether the job was submitted via the API or from Agent CLI
- command- The command which was already selected (if there was one)
- clusters- The clusters to choose from
 
 
- 
 - 
Method Detail- 
getCommandpublic java.util.Optional<Command> getCommand() Get the command which was already selected for the job if there was one.This is currently returning an optional due to the support for v3 and v4 algorithms. Once v4 is the only resource selection algorithm command will no longer be optional. - Returns:
- The Commandwrapped in anOptional
 
 - 
getResourcespublic java.util.Set<Cluster> getResources() Return theSetof distinct resources that a selector is meant to chose from.- Specified by:
- getResourcesin class- ResourceSelectionContext<Cluster>
- Returns:
- The resources
 
 
- 
 
-