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 -
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
ConstructorInitialize scores for each node to 0.
- Parameters:
executors- Collection
-
-
Method Details
-
getNodes
Get nodes to score.same to retrieve
MappingWorksheet.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 call
addScore(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 call
resetScore(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 call
getScore(Node)for executor.node.- Parameters:
executor-- Returns:
-
markInvalid
Make the task not run on this node.Same to call
markInvalid(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:
-