Class ScoringRule
java.lang.Object
hudson.model.AbstractDescribableImpl<ScoringRule>
jp.ikedam.jenkins.plugins.scoringloadbalancer.ScoringRule
- All Implemented Interfaces:
ExtensionPoint
,Describable<ScoringRule>
- Direct Known Subclasses:
BuildResultScoringRule
,NodeLoadScoringRule
,NodePreferenceScoringRule
public abstract class ScoringRule
extends AbstractDescribableImpl<ScoringRule>
implements ExtensionPoint
Scores nodes to determine which is proper to have a task build on.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionall()
Returns allScoringRule
s registered to Jenkins.abstract boolean
updateScores
(Queue.Task task, MappingWorksheet.WorkChunk wc, MappingWorksheet.Mapping m, ScoringLoadBalancer.NodesScore nodesScore) Score the nodes.Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
ScoringRule
public ScoringRule()
-
-
Method Details
-
updateScores
public abstract boolean updateScores(Queue.Task task, MappingWorksheet.WorkChunk wc, MappingWorksheet.Mapping m, ScoringLoadBalancer.NodesScore nodesScore) throws Exception Score the nodes. Update scores by calling methods of nodesScore. A node with a larger score is preferred to use. If you want not to have scores updated with subsequentScoringRule
s, return false.- Parameters:
task
- the root task to build.wc
- Current work chunk (a set of subtasks that must run on the same node).m
- currently mapping status. there may be nodes already assigned.nodesScore
- a map from nodes to their scores- Returns:
- whether to score with subsequent
ScoringRule
. - Throws:
Exception
- if any exception occurs,ScoringLoadBalancer
falls back to aLoadBalancer
registered originally.
-
all
Returns allScoringRule
s registered to Jenkins.- Returns:
- list of
Descriptor
ofScoringRule
s.
-