public class InMemoryStore extends Object implements SkylineStore
SkylineStore.| Constructor and Description |
|---|
InMemoryStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
addEstimation(String pipelineId,
org.apache.hadoop.yarn.server.resourcemanager.reservation.RLESparseResourceAllocation resourceSkyline)
Add job's predicted
Resource allocation to the store
indexed by the pipelineId. |
void |
addHistory(RecurrenceId recurrenceId,
List<ResourceSkyline> resourceSkylines)
Add job's resource skyline to the store indexed by the job's
RecurrenceId. |
void |
deleteHistory(RecurrenceId recurrenceId)
Delete all
ResourceSkylines belonging to given
RecurrenceId. |
org.apache.hadoop.yarn.server.resourcemanager.reservation.RLESparseResourceAllocation |
getEstimation(String pipelineId)
Return the predicted
Resource allocation for the pipeline. |
Map<RecurrenceId,List<ResourceSkyline>> |
getHistory(RecurrenceId recurrenceId)
Return all
ResourceSkylines belonging to RecurrenceId. |
void |
updateHistory(RecurrenceId recurrenceId,
List<ResourceSkyline> resourceSkylines)
Update
RecurrenceId with given ResourceSkylines. |
public final void addHistory(RecurrenceId recurrenceId, List<ResourceSkyline> resourceSkylines) throws SkylineStoreException
HistorySkylineStoreRecurrenceId. RecurrenceId is used to identify recurring
pipeline jobs, and we assume that ResourceEstimatorServer users will provide the correct
RecurrenceId. If ResourceSkylines to be added contain
null elements, the function will skip them.
addHistory in interface HistorySkylineStorerecurrenceId - the unique id of user's recurring pipeline jobs.resourceSkylines - the list of ResourceSkylines in one run.SkylineStoreException - if: (1) input parameters are invalid; (2)
ResourceSkylines to be added contain some duplicate
RecurrenceIds which already exist in the
HistorySkylineStore.public void addEstimation(String pipelineId, org.apache.hadoop.yarn.server.resourcemanager.reservation.RLESparseResourceAllocation resourceSkyline) throws SkylineStoreException
PredictionSkylineStoreResource allocation to the store
indexed by the pipelineId.
Note that right now we only keep the latest copy of predicted
Resource allocation for the recurring pipeline.
addEstimation in interface PredictionSkylineStorepipelineId - the id of the recurring pipeline.resourceSkyline - the predicted Resource allocation for the
pipeline.SkylineStoreException - if input parameters are invalid.public final void deleteHistory(RecurrenceId recurrenceId) throws SkylineStoreException
HistorySkylineStoreResourceSkylines belonging to given
RecurrenceId.
Note that for safety considerations, we only allow users to
deleteHistory ResourceSkylines of one job run.
deleteHistory in interface HistorySkylineStorerecurrenceId - the unique id of user's recurring pipeline jobs.SkylineStoreException - if: (1) input parameters are invalid; (2)
recurrenceId does not exist in the HistorySkylineStore.public final void updateHistory(RecurrenceId recurrenceId, List<ResourceSkyline> resourceSkylines) throws SkylineStoreException
HistorySkylineStoreRecurrenceId with given ResourceSkylines. This
function will deleteHistory all the ResourceSkylines belonging to
the RecurrenceId, and re-insert the given ResourceSkylines
to the SkylineStore.
If ResourceSkylines contain null elements,
the function will skip them.
updateHistory in interface HistorySkylineStorerecurrenceId - the unique id of the pipeline job.resourceSkylines - the list of ResourceSkylines in one run.SkylineStoreException - if: (1) input parameters are invalid; (2)
recurrenceId does not exist in the SkylineStore.public final Map<RecurrenceId,List<ResourceSkyline>> getHistory(RecurrenceId recurrenceId) throws SkylineStoreException
HistorySkylineStoreResourceSkylines belonging to RecurrenceId.
This function supports the following special wildcard operations
regarding RecurrenceId: If the pipelineId is "*", it will
return all entries in the store; else, if the runId is "*", it
will return all ResourceSkylines belonging to the
pipelineId; else, it will return all ResourceSkylines
belonging to the {pipelineId, runId}. If the
RecurrenceId does not exist, it will return null.
getHistory in interface HistorySkylineStorerecurrenceId - the unique id of the pipeline job.ResourceSkylines belonging to the recurrenceId.SkylineStoreException - if recurrenceId is null.public final org.apache.hadoop.yarn.server.resourcemanager.reservation.RLESparseResourceAllocation getEstimation(String pipelineId) throws SkylineStoreException
PredictionSkylineStoreResource allocation for the pipeline.
If the pipelineId does not exist, it will return null.
getEstimation in interface PredictionSkylineStorepipelineId - the unique id of the pipeline.Resource allocation for the pipeline.SkylineStoreException - if pipelineId is null.Copyright © 2019 Apache Software Foundation. All Rights Reserved.