Class ScoringLoadBalancer.NodesScore

java.lang.Object
jp.ikedam.jenkins.plugins.scoringloadbalancer.ScoringLoadBalancer.NodesScore
Enclosing class:
ScoringLoadBalancer

public static class ScoringLoadBalancer.NodesScore extends Object
Holds scores of nodes. A node with a larger score is preferred to use.
  • Constructor Details

  • Method Details

    • getNodes

      public Collection<Node> getNodes()
      Get nodes to score. same to retrieve MappingWorksheet.ExecutorChunk.node for getExecutorChunks()
      Returns:
      nodes to score.
    • getExecutorChunks

      public Collection<MappingWorksheet.ExecutorChunk> getExecutorChunks()
      Get executors to score.
      Returns:
      executors to score.
    • addScore

      public void addScore(Node node, int score)
      Add score to the node.
      Parameters:
      node -
      score -
    • addScore

      public void addScore(MappingWorksheet.ExecutorChunk executor, int score)
      Add score to the node. Same to call addScore(Node, int) for executor.node
      Parameters:
      executor -
      score -
    • resetScore

      public void resetScore(Node node)
      Reset the score of the node to 0.
      Parameters:
      node -
    • resetScore

      public void resetScore(MappingWorksheet.ExecutorChunk executor)
      Reset the score of the node to 0. Same to call resetScore(Node) for executor.node
      Parameters:
      executor -
    • getScore

      public int getScore(Node node)
      Get the score of the node.
      Parameters:
      node -
      Returns:
    • getScore

      public int getScore(MappingWorksheet.ExecutorChunk executor)
      Get the score of the node. Same to call getScore(Node) for executor.node.
      Parameters:
      executor -
      Returns:
    • markInvalid

      public void markInvalid(MappingWorksheet.ExecutorChunk executor)
      Make the task not run on this node. Same to call markInvalid(Node) for executor.node.
      Parameters:
      executor -
    • markInvalid

      public void markInvalid(Node node)
      Make the task not run on this node.
      Parameters:
      node -
    • resetInvalid

      public void resetInvalid()
      Reset invalid marks on all nodes.
    • markAllInvalid

      public void markAllInvalid()
      Mark all nodes invalid.
    • isInvalid

      public boolean isInvalid(MappingWorksheet.ExecutorChunk executor)
      Same to call isInvalid(Node) for executor.node.
      Parameters:
      executor -
      Returns:
    • isInvalid

      public boolean isInvalid(Node node)
      Parameters:
      node -
      Returns: