Class ClusterSelectionContext

java.lang.Object
com.netflix.genie.web.selectors.ResourceSelectionContext<com.netflix.genie.common.internal.dtos.Cluster>
com.netflix.genie.web.selectors.ClusterSelectionContext

public class ClusterSelectionContext extends ResourceSelectionContext<com.netflix.genie.common.internal.dtos.Cluster>
Extension of ResourceSelectionContext to include specific data useful in cluster selection.
Since:
4.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    ClusterSelectionContext(@NotEmpty String jobId, @NotNull com.netflix.genie.common.internal.dtos.JobRequest jobRequest, boolean apiJob, @Valid com.netflix.genie.common.internal.dtos.Command command, @NotEmpty Set<@Valid com.netflix.genie.common.internal.dtos.Cluster> clusters)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<com.netflix.genie.common.internal.dtos.Command>
    Get the command which was already selected for the job if there was one.
    Set<com.netflix.genie.common.internal.dtos.Cluster>
    Return the Set of distinct resources that a selector is meant to chose from.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ClusterSelectionContext

      public ClusterSelectionContext(@NotEmpty @NotEmpty String jobId, @NotNull @NotNull com.netflix.genie.common.internal.dtos.JobRequest jobRequest, boolean apiJob, @Nullable @Valid @Valid com.netflix.genie.common.internal.dtos.Command command, @NotEmpty @NotEmpty Set<@Valid com.netflix.genie.common.internal.dtos.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 Details

    • getCommand

      public Optional<com.netflix.genie.common.internal.dtos.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 Command wrapped in an Optional
    • getResources

      public Set<com.netflix.genie.common.internal.dtos.Cluster> getResources()
      Return the Set of distinct resources that a selector is meant to chose from.
      Specified by:
      getResources in class ResourceSelectionContext<com.netflix.genie.common.internal.dtos.Cluster>
      Returns:
      The resources