Class ScoringLoadBalancer.NodesScore
java.lang.Object
jp.ikedam.jenkins.plugins.scoringloadbalancer.ScoringLoadBalancer.NodesScore
- Enclosing class:
- ScoringLoadBalancer
Holds scores of nodes.
A node with a larger score is preferred to use.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionNodesScore(Collection<MappingWorksheet.ExecutorChunk> executors) Constructor Initialize scores for each nodes to 0. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd score to the node.voidaddScore(MappingWorksheet.ExecutorChunk executor, int score) Add score to the node.Get executors to score.getNodes()Get nodes to score.intGet the score of the node.intgetScore(MappingWorksheet.ExecutorChunk executor) Get the score of the node.booleanbooleanisInvalid(MappingWorksheet.ExecutorChunk executor) Same to callisInvalid(Node)for executor.node.voidMark all nodes invalid.voidmarkInvalid(Node node) Make the task not run on this node.voidmarkInvalid(MappingWorksheet.ExecutorChunk executor) Make the task not run on this node.voidReset invalid marks on all nodes.voidresetScore(Node node) Reset the score of the node to 0.voidresetScore(MappingWorksheet.ExecutorChunk executor) Reset the score of the node to 0.
-
Constructor Details
-
NodesScore
Constructor Initialize scores for each nodes to 0.- Parameters:
executors-
-
-
Method Details
-
getNodes
Get nodes to score. same to retrieveMappingWorksheet.ExecutorChunk.nodeforgetExecutorChunks()- Returns:
- nodes to score.
-
getExecutorChunks
Get executors to score.- Returns:
- executors to score.
-
addScore
Add score to the node.- Parameters:
node-score-
-
addScore
Add score to the node. Same to calladdScore(Node, int)for executor.node- Parameters:
executor-score-
-
resetScore
Reset the score of the node to 0.- Parameters:
node-
-
resetScore
Reset the score of the node to 0. Same to callresetScore(Node)for executor.node- Parameters:
executor-
-
getScore
Get the score of the node.- Parameters:
node-- Returns:
-
getScore
Get the score of the node. Same to callgetScore(Node)for executor.node.- Parameters:
executor-- Returns:
-
markInvalid
Make the task not run on this node. Same to callmarkInvalid(Node)for executor.node.- Parameters:
executor-
-
markInvalid
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
Same to callisInvalid(Node)for executor.node.- Parameters:
executor-- Returns:
-
isInvalid
- Parameters:
node-- Returns:
-