public class ClusterSelectionContext extends ResourceSelectionContext<com.netflix.genie.common.external.dtos.v4.Cluster>
ResourceSelectionContext to include specific data useful in cluster selection.| Constructor and Description |
|---|
ClusterSelectionContext(@NotEmpty java.lang.String jobId,
@NotNull com.netflix.genie.common.external.dtos.v4.JobRequest jobRequest,
boolean apiJob,
@Valid com.netflix.genie.common.external.dtos.v4.Command command,
@NotEmpty java.util.Set<com.netflix.genie.common.external.dtos.v4.Cluster> clusters)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Optional<com.netflix.genie.common.external.dtos.v4.Command> |
getCommand()
Get the command which was already selected for the job if there was one.
|
java.util.Set<com.netflix.genie.common.external.dtos.v4.Cluster> |
getResources()
Return the
Set of distinct resources that a selector is meant to chose from. |
public ClusterSelectionContext(@NotEmpty
@NotEmpty java.lang.String jobId,
@NotNull
@NotNull com.netflix.genie.common.external.dtos.v4.JobRequest jobRequest,
boolean apiJob,
@Nullable @Valid
@Valid com.netflix.genie.common.external.dtos.v4.Command command,
@NotEmpty
@NotEmpty java.util.Set<com.netflix.genie.common.external.dtos.v4.Cluster> clusters)
jobId - The id of the job which the command is being selected forjobRequest - The job request the user originally madeapiJob - Whether the job was submitted via the API or from Agent CLIcommand - The command which was already selected (if there was one)clusters - The clusters to choose frompublic java.util.Optional<com.netflix.genie.common.external.dtos.v4.Command> getCommand()
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.
Command wrapped in an Optionalpublic java.util.Set<com.netflix.genie.common.external.dtos.v4.Cluster> getResources()
Set of distinct resources that a selector is meant to chose from.getResources in class ResourceSelectionContext<com.netflix.genie.common.external.dtos.v4.Cluster>