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
Constructors Constructor Description ScoringRule()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static DescriptorExtensionList<ScoringRule,Descriptor<ScoringRule>>
all()
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
-
-
-
-
Method Detail
-
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
public static DescriptorExtensionList<ScoringRule,Descriptor<ScoringRule>> all()
Returns allScoringRule
s registered to Jenkins.- Returns:
- list of
Descriptor
ofScoringRule
s.
-
-