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 -
Method Summary
Modifier and TypeMethodDescriptionall()Returns allScoringRules registered to Jenkins.abstract booleanupdateScores(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 subsequentScoringRules, 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,ScoringLoadBalancerfalls back to aLoadBalancerregistered originally.
-
all
Returns allScoringRules registered to Jenkins.- Returns:
- list of
DescriptorofScoringRules.
-