public class MappingWorksheet extends Object
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 of SubTask
s), and we are also given a number
of idle Executor
s, and our goal is to find a mapping from the former to the latter,
which determines where each SubTask
gets executed.
This mapping is done under the following constraints:
SubTask.getSameNodeConstraint()
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 single MappingWorksheet.WorkChunk
. Similarly,
we consider a set of all Executor
s from the same node as MappingWorksheet.ExecutorChunk
.
Now, the problem becomes the weighted matching problem from MappingWorksheet.WorkChunk
to MappingWorksheet.ExecutorChunk
.
An instance of MappingWorksheet
captures a problem definition, plus which
MappingWorksheet.ExecutorChunk
and MappingWorksheet.WorkChunk
are compatible. The purpose of this class
(and MappingWorksheet.ExecutorChunk
and MappingWorksheet.WorkChunk
) are to expose a lot of convenience methods
to assist various algorithms that produce the solution of this mapping problem,
which is represented as MappingWorksheet.Mapping
.
LoadBalancer.map(Queue.Task, MappingWorksheet)
Modifier and Type | Class and 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. |
Modifier and Type | Field and 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 and Description |
---|
MappingWorksheet(Queue.BuildableItem item,
List<? extends MappingWorksheet.ExecutorSlot> offers) |
MappingWorksheet(Queue.BuildableItem item,
List<? extends MappingWorksheet.ExecutorSlot> offers,
Collection<? extends LoadPredictor> loadPredictors) |
Modifier and Type | Method and Description |
---|---|
MappingWorksheet.ExecutorChunk |
executors(int index) |
MappingWorksheet.WorkChunk |
works(int index) |
public final List<MappingWorksheet.ExecutorChunk> executors
public final List<MappingWorksheet.WorkChunk> works
public final Queue.BuildableItem item
Queue.BuildableItem
for which we are trying to figure out the execution plan. Never null.public MappingWorksheet(Queue.BuildableItem item, List<? extends MappingWorksheet.ExecutorSlot> offers)
public MappingWorksheet(Queue.BuildableItem item, List<? extends MappingWorksheet.ExecutorSlot> offers, Collection<? extends LoadPredictor> loadPredictors)
public MappingWorksheet.WorkChunk works(int index)
public MappingWorksheet.ExecutorChunk executors(int index)
Copyright © 2014. All rights reserved.