Interface LabelAssignmentAction

  • All Superinterfaces:
    Action, ModelObject
    All Known Implementing Classes:
    ParametersAction

    public interface LabelAssignmentAction
    extends Action
    Action that can be submitted to Queue that controls where the task runs.

    Where to insert LabelAssignmentActions

    If you control when the task gets submitted to the queue, you can associate this action to the task by passing it as a parameter to method like Queue.schedule(Task, int, Action...).

    If you want to globally affect the scheduling decision, you can do so by Queue.QueueDecisionHandler and alter the list of actions that you get. Alternatively, you can implement your own LoadBalancer and bypass the whole label/assignment mechanism to control the decision into your own hands.

    Since:
    1.416
    Author:
    Kohsuke Kawaguchi
    • Method Detail

      • getAssignedLabel

        Label getAssignedLabel​(@NonNull
                               SubTask task)
        Reassigns where the task gets run.
        Parameters:
        task - Never null.
        Returns:
        null to let other LabelAssignmentActions take control, eventually to SubTask.getAssignedLabel(). If non-null value is returned, that label will be authoritative.