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
-
Constructor Summary
ConstructorDescriptionNodesScore
(Collection<MappingWorksheet.ExecutorChunk> executors) Constructor Initialize scores for each nodes to 0. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add score to the node.void
addScore
(MappingWorksheet.ExecutorChunk executor, int score) Add score to the node.Get executors to score.getNodes()
Get nodes to score.int
Get the score of the node.int
getScore
(MappingWorksheet.ExecutorChunk executor) Get the score of the node.boolean
boolean
isInvalid
(MappingWorksheet.ExecutorChunk executor) Same to callisInvalid(Node)
for executor.node.void
Mark all nodes invalid.void
markInvalid
(Node node) Make the task not run on this node.void
markInvalid
(MappingWorksheet.ExecutorChunk executor) Make the task not run on this node.void
Reset invalid marks on all nodes.void
resetScore
(Node node) Reset the score of the node to 0.void
resetScore
(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.node
forgetExecutorChunks()
- 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:
-