Class MappingWorksheet
- java.lang.Object
-
- hudson.model.queue.MappingWorksheet
-
public class MappingWorksheet extends Object
Defines a mapping problem for answering "where do we execute this task?"The heart of the placement problem is a mapping problem. We are given a
Queue.Task
, (which in the general case consists of a set ofSubTask
s), and we are also given a number of idleExecutor
s, and our goal is to find a mapping from the former to the latter, which determines where eachSubTask
gets executed.This mapping is done under the following constraints:
-
"Same node" constraint. Some of the subtasks need to be co-located on the same node.
See
SubTask.getSameNodeConstraint()
-
Label constraint.
SubTask
s can specify that it can be only run on nodes that has the label.
We first fold the former constraint into the problem definition. That is, we now consider a set of
SubTask
s that need to be co-located as a singleMappingWorksheet.WorkChunk
. Similarly, we consider a set of allExecutor
s from the same node asMappingWorksheet.ExecutorChunk
. Now, the problem becomes the weighted matching problem fromMappingWorksheet.WorkChunk
toMappingWorksheet.ExecutorChunk
.An instance of
MappingWorksheet
captures a problem definition, plus whichMappingWorksheet.ExecutorChunk
andMappingWorksheet.WorkChunk
are compatible. The purpose of this class (andMappingWorksheet.ExecutorChunk
andMappingWorksheet.WorkChunk
) are to expose a lot of convenience methods to assist various algorithms that produce the solution of this mapping problem, which is represented asMappingWorksheet.Mapping
.- Author:
- Kohsuke Kawaguchi
- See Also:
LoadBalancer.map(Queue.Task, MappingWorksheet)
-
"Same node" constraint. Some of the subtasks need to be co-located on the same node.
See
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
MappingWorksheet.ExecutorChunk
static class
MappingWorksheet.ExecutorSlot
class
MappingWorksheet.Mapping
Represents the solution to the mapping problem.class
MappingWorksheet.WorkChunk
SubTask
s that need to run on the same node.
-
Field Summary
Fields Modifier and Type Field Description List<MappingWorksheet.ExecutorChunk>
executors
Queue.BuildableItem
item
Queue.BuildableItem
for which we are trying to figure out the execution plan.List<MappingWorksheet.WorkChunk>
works
-
Constructor Summary
Constructors Constructor Description MappingWorksheet(Queue.BuildableItem item, List<? extends MappingWorksheet.ExecutorSlot> offers)
MappingWorksheet(Queue.BuildableItem item, List<? extends MappingWorksheet.ExecutorSlot> offers, Collection<? extends LoadPredictor> loadPredictors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MappingWorksheet.ExecutorChunk
executors(int index)
MappingWorksheet.WorkChunk
works(int index)
-
-
-
Field Detail
-
executors
public final List<MappingWorksheet.ExecutorChunk> executors
-
works
public final List<MappingWorksheet.WorkChunk> works
-
item
public final Queue.BuildableItem item
Queue.BuildableItem
for which we are trying to figure out the execution plan. Never null.
-
-
Constructor Detail
-
MappingWorksheet
public MappingWorksheet(Queue.BuildableItem item, List<? extends MappingWorksheet.ExecutorSlot> offers)
-
MappingWorksheet
public MappingWorksheet(Queue.BuildableItem item, List<? extends MappingWorksheet.ExecutorSlot> offers, Collection<? extends LoadPredictor> loadPredictors)
-
-
Method Detail
-
works
public MappingWorksheet.WorkChunk works(int index)
-
executors
public MappingWorksheet.ExecutorChunk executors(int index)
-
-