@Singleton public class ResourceEstimatorService extends Object
| Constructor and Description |
|---|
ResourceEstimatorService() |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteHistoryResourceSkyline(String pipelineId,
String runId)
Delete history
ResourceSkylines from SkylineStore. |
String |
getEstimatedResourceAllocation(String pipelineId)
Get estimated {code Resource} allocation for the pipeline.
|
String |
getHistoryResourceSkyline(String pipelineId,
String runId)
Get history
ResourceSkyline from SkylineStore. |
String |
getPrediction(String pipelineId)
Get predicted {code Resource} allocation for the pipeline.
|
void |
parseFile(String logFile)
Parse the log file.
|
public ResourceEstimatorService()
throws ResourceEstimatorException
ResourceEstimatorExceptionpublic void parseFile(String logFile) throws IOException, SkylineStoreException, ResourceEstimatorException
LogParser.parseStream(InputStream).logFile - file/directory of the log to be parsed.IOException - if fails to parse the log.SkylineStoreException - if fails to addHistory to
SkylineStore.ResourceEstimatorException - if the LogParser
is not initialized.public String getPrediction(String pipelineId) throws SolverException, SkylineStoreException
SkylineStore, it
will directly get the prediction from SkylineStore, otherwise it
will call the Solver to make prediction, and store the predicted
{code Resource} allocation to the SkylineStore. Note that invoking
Solver could be a time-consuming operation.pipelineId - the id of the pipeline.RLESparseResourceAllocation.SolverException - if Solver fails;SkylineStoreException - if fails to get history
ResourceSkyline or predicted {code Resource} allocation
from SkylineStore.public String getHistoryResourceSkyline(String pipelineId, String runId) throws SkylineStoreException
ResourceSkyline from SkylineStore. 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 not do
anything.pipelineId - pipelineId of the history run.runId - runId of the history run.ResourceSkylines.SkylineStoreException - if fails to getHistory
ResourceSkyline from SkylineStore.public String getEstimatedResourceAllocation(String pipelineId) throws SkylineStoreException
pipelineId - id of the pipeline.RLESparseResourceAllocation.SkylineStoreException - if fails to get estimated {code Resource}
allocation from SkylineStore.public void deleteHistoryResourceSkyline(String pipelineId, String runId) throws SkylineStoreException
ResourceSkylines from SkylineStore.
Note that for safety considerations, we only allow users to delete
history ResourceSkylines of one job run.
pipelineId - pipelineId of the history run.runId - runId runId of the history run.SkylineStoreException - if fails to deleteHistory
ResourceSkylines.Copyright © 2019 Apache Software Foundation. All Rights Reserved.