public class ActionDBAccessorImpl extends Object implements ActionDBAccessor
| Constructor and Description |
|---|
ActionDBAccessorImpl(long cacheLimit) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortHostRole(String host,
long requestId,
long stageId,
String role)
Mark the task as to have been aborted
|
void |
abortHostRole(String host,
long requestId,
long stageId,
String role,
String reason)
Mark the task as to have been aborted.
|
void |
abortOperation(long requestId)
Abort all outstanding operations associated with the given request
|
void |
endRequest(long requestId) |
void |
endRequestIfCompleted(long requestId) |
List<Stage> |
getAllStages(long requestId)
Get all stages associated with a single request id
|
List<HostRoleCommand> |
getAllTasksByRequestIds(Collection<Long> requestIds)
Given a list of request ids, get all the tasks that belong to these requests
|
long |
getLastPersistedRequestIdWhenInitialized()
Return the last persisted Request ID as seen when the DBAccessor object
was initialized.
|
Request |
getRequest(long requestId)
Get request object by id
|
Map<Long,String> |
getRequestContext(List<Long> requestIds)
Gets request contexts associated with the list of request id
|
String |
getRequestContext(long requestId)
Gets the request context associated with the request id
|
List<Long> |
getRequestIds()
Get all requests
|
List<Request> |
getRequests(Collection<Long> requestIds)
Gets request objects by ids
|
List<Long> |
getRequestsByStatus(RequestStatus status)
Gets request id of request that are in the specified status
|
List<HostRoleCommand> |
getRequestTasks(long requestId)
Given a request id, get all the tasks that belong to this request
|
Stage |
getStage(String actionId)
Given an action id of the form requestId-stageId, retrieve the Stage
|
List<Stage> |
getStagesByHostRoleStatus(Set<HostRoleStatus> statuses)
Get all stages that contain tasks with specified host role statuses
|
List<Stage> |
getStagesInProgress()
Returns all the pending stages, including queued and not-queued.
|
HostRoleCommand |
getTask(long taskId)
Gets the host role command corresponding to the task id
|
List<HostRoleCommand> |
getTasks(Collection<Long> taskIds)
Given a list of task ids, get all the host role commands
|
List<HostRoleCommand> |
getTasksByRequestAndTaskIds(Collection<Long> requestIds,
Collection<Long> taskIds)
Get a list of host role commands where the request id belongs to the input requestIds and
the task id belongs to the input taskIds
|
void |
hostRoleScheduled(Stage s,
String hostname,
String roleStr)
Updates scheduled stage.
|
void |
persistActions(Request request)
Persists all tasks for a given request
|
void |
setSourceScheduleForRequest(long requestId,
long scheduleId)
Updates request with link to source schedule
|
void |
startRequest(long requestId) |
void |
timeoutHostRole(String host,
long requestId,
long stageId,
String role)
Mark the task as to have timed out
|
void |
updateHostRoleState(String hostname,
long requestId,
long stageId,
String role,
CommandReport report)
For the given host, update all the tasks based on the command report
|
void |
updateHostRoleStates(Collection<CommandReport> reports)
Update tasks according to command reports
|
public Stage getStage(String actionId)
ActionDBAccessorgetStage in interface ActionDBAccessorpublic List<Stage> getAllStages(long requestId)
ActionDBAccessorgetAllStages in interface ActionDBAccessorpublic Request getRequest(long requestId)
ActionDBAccessorgetRequest in interface ActionDBAccessorpublic void abortOperation(long requestId)
ActionDBAccessorabortOperation in interface ActionDBAccessorpublic void timeoutHostRole(String host, long requestId, long stageId, String role)
ActionDBAccessortimeoutHostRole in interface ActionDBAccessorpublic List<Stage> getStagesInProgress()
ActionDBAccessorgetStagesInProgress in interface ActionDBAccessorpublic void persistActions(Request request)
ActionDBAccessorpersistActions in interface ActionDBAccessorrequest - request objectpublic void startRequest(long requestId)
startRequest in interface ActionDBAccessorpublic void endRequest(long requestId)
endRequest in interface ActionDBAccessorpublic void endRequestIfCompleted(long requestId)
public void setSourceScheduleForRequest(long requestId,
long scheduleId)
ActionDBAccessorsetSourceScheduleForRequest in interface ActionDBAccessorpublic void updateHostRoleStates(Collection<CommandReport> reports)
ActionDBAccessorupdateHostRoleStates in interface ActionDBAccessorpublic void updateHostRoleState(String hostname, long requestId, long stageId, String role, CommandReport report)
ActionDBAccessorupdateHostRoleState in interface ActionDBAccessorpublic void abortHostRole(String host, long requestId, long stageId, String role)
ActionDBAccessorabortHostRole in interface ActionDBAccessorpublic void abortHostRole(String host, long requestId, long stageId, String role, String reason)
ActionDBAccessorabortHostRole in interface ActionDBAccessorpublic long getLastPersistedRequestIdWhenInitialized()
ActionDBAccessorgetLastPersistedRequestIdWhenInitialized in interface ActionDBAccessorpublic void hostRoleScheduled(Stage s, String hostname, String roleStr)
ActionDBAccessorhostRoleScheduled in interface ActionDBAccessorpublic List<HostRoleCommand> getRequestTasks(long requestId)
ActionDBAccessorgetRequestTasks in interface ActionDBAccessorpublic List<HostRoleCommand> getAllTasksByRequestIds(Collection<Long> requestIds)
ActionDBAccessorgetAllTasksByRequestIds in interface ActionDBAccessorpublic List<HostRoleCommand> getTasksByRequestAndTaskIds(Collection<Long> requestIds, Collection<Long> taskIds)
ActionDBAccessorgetTasksByRequestAndTaskIds in interface ActionDBAccessorpublic List<HostRoleCommand> getTasks(Collection<Long> taskIds)
ActionDBAccessorgetTasks in interface ActionDBAccessorpublic List<Stage> getStagesByHostRoleStatus(Set<HostRoleStatus> statuses)
ActionDBAccessorgetStagesByHostRoleStatus in interface ActionDBAccessorpublic List<Long> getRequestIds()
ActionDBAccessorgetRequestIds in interface ActionDBAccessorpublic HostRoleCommand getTask(long taskId)
ActionDBAccessorgetTask in interface ActionDBAccessorpublic List<Long> getRequestsByStatus(RequestStatus status)
ActionDBAccessorgetRequestsByStatus in interface ActionDBAccessorpublic Map<Long,String> getRequestContext(List<Long> requestIds)
ActionDBAccessorgetRequestContext in interface ActionDBAccessorpublic String getRequestContext(long requestId)
ActionDBAccessorgetRequestContext in interface ActionDBAccessorpublic List<Request> getRequests(Collection<Long> requestIds)
ActionDBAccessorgetRequests in interface ActionDBAccessorCopyright © 2016. All rights reserved.