public class SolverPreprocessor
extends java.lang.Object
Solver.| Constructor | Description |
|---|---|
SolverPreprocessor() |
| Modifier and Type | Method | Description |
|---|---|---|
java.util.List<ResourceSkyline> |
aggregateSkylines(java.util.Map<RecurrenceId,java.util.List<ResourceSkyline>> jobHistory,
int minJobRuns) |
Aggregate all job's
ResourceSkylines in the one run of recurring
pipeline, and return the aggregated ResourceSkylines in different
runs. |
int[] |
getDiscreteSkyline(org.apache.hadoop.yarn.server.resourcemanager.reservation.RLESparseResourceAllocation skyList,
int timeInterval,
long containerMemAlloc,
int jobLen) |
Discretize job's lifespan into intervals, and return the number of
containers used by the job within each interval.
|
long |
getResourceVector(org.apache.hadoop.yarn.server.resourcemanager.reservation.RLESparseResourceAllocation skyList,
int index,
long containerMemAlloc) |
Return the multi-dimension resource vector consumed by the job at specified
time.
|
ResourceSkyline |
mergeSkyline(java.util.List<ResourceSkyline> resourceSkylines) |
Merge different jobs' resource skylines into one within the same pipeline.
|
void |
validate(java.util.Map<RecurrenceId,java.util.List<ResourceSkyline>> jobHistory,
int timeInterval) |
Check if Solver's input parameters are valid.
|
public final void validate(java.util.Map<RecurrenceId,java.util.List<ResourceSkyline>> jobHistory, int timeInterval) throws InvalidInputException
jobHistory - the history ResourceSkylines of the recurring
pipeline job.timeInterval - the time interval which is used to discretize the
history ResourceSkylines.InvalidInputException - if: (1) jobHistory is null;
(2) jobHistory is empty; (3) timeout is non-positive;
(4) timeInterval is non-positive;public final long getResourceVector(org.apache.hadoop.yarn.server.resourcemanager.reservation.RLESparseResourceAllocation skyList,
int index,
long containerMemAlloc)
skyList - the list of Resources used by the job.index - the discretized time index.containerMemAlloc - the multi-dimension resource vector allocated to
one container.public final int[] getDiscreteSkyline(org.apache.hadoop.yarn.server.resourcemanager.reservation.RLESparseResourceAllocation skyList,
int timeInterval,
long containerMemAlloc,
int jobLen)
Note that here we assume all containers allocated to the job have the
same Resource. This is due to the limit of
RLESparseResourceAllocation.
skyList - the list of Resources used by the job.timeInterval - the time interval used to discretize the job's
lifespan.containerMemAlloc - the amount of memory allocated to each container.jobLen - the duration of the job.public final ResourceSkyline mergeSkyline(java.util.List<ResourceSkyline> resourceSkylines)
resourceSkylines - different jobs' resource skylines within the same
pipeline.public final java.util.List<ResourceSkyline> aggregateSkylines(java.util.Map<RecurrenceId,java.util.List<ResourceSkyline>> jobHistory, int minJobRuns) throws InvalidInputException
ResourceSkylines in the one run of recurring
pipeline, and return the aggregated ResourceSkylines in different
runs.jobHistory - the history ResourceSkyline of the recurring
pipeline job.minJobRuns - the minimum number of job runs required to run the
solver.ResourceSkylines in different runs.InvalidInputException - if: (1) job submission time parsing fails;
(2) jobHistory has less job runs than the minimum requirement;Copyright © 2008–2025 Apache Software Foundation. All rights reserved.