public interface ActionDBAccessor
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.
|
Collection<HostRoleCommandEntity> |
abortOperation(long requestId)
Abort all outstanding operations associated with the given request.
|
void |
bulkAbortHostRole(Stage s,
Map<ExecutionCommand,String> commands)
Bulk abort commands
|
void |
bulkHostRoleScheduled(Stage s,
List<ExecutionCommand> commands)
Bulk update scheduled commands
|
void |
endRequest(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
|
int |
getCommandsInProgressCount()
Gets the number of commands in progress.
|
List<Stage> |
getFirstStageInProgressPerRequest()
Returns the next stage which is in-progress for every in-progress request
in the system.
|
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
|
RequestEntity |
getRequestEntity(long requestId)
Gets the request entity by id.
|
List<Request> |
getRequests(Collection<Long> requestIds)
Gets request objects by ids
|
List<Long> |
getRequestsByStatus(RequestStatus status,
int maxResults,
boolean ascOrder)
Get first or last maxResults requests 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> |
getStagesInProgressForRequest(Long requestId)
Returns all the pending stages in a request, including queued and not-queued.
|
HostRoleCommand |
getTask(long taskId)
Gets the host role command corresponding to the task id
|
Collection<HostRoleCommand> |
getTasks(Collection<Long> taskIds)
Given a list of task ids, get all the host role commands
|
List<HostRoleCommand> |
getTasksByHostRoleAndStatus(String hostname,
String role,
HostRoleStatus status)
Get a List of host role commands where the host, role and status are as specified
|
List<HostRoleCommand> |
getTasksByRoleAndStatus(String role,
HostRoleStatus status)
Get a List of host role commands where the role and status are as specified
|
void |
hostRoleScheduled(Stage s,
String hostname,
String roleStr)
Updates scheduled stage.
|
void |
persistActions(Request request)
Persists all tasks for a given request
|
void |
resubmitTasks(List<Long> taskIds)
Resubmits a series of tasks
|
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 |
timeoutHostRole(String host,
long requestId,
long stageId,
String role,
boolean skipSupported,
boolean hostUnknownState)
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
|
Stage getStage(String actionId)
List<Stage> getAllStages(long requestId)
RequestEntity getRequestEntity(long requestId)
Request getRequest(long requestId)
requestId
- the request idCollection<HostRoleCommandEntity> abortOperation(long requestId)
HostRoleStatus.SCHEDULED_STATES
to determine which
HostRoleCommand
instances to abort.
Returns the list of the aborted operations.void timeoutHostRole(String host, long requestId, long stageId, String role)
void timeoutHostRole(String host, long requestId, long stageId, String role, boolean skipSupported, boolean hostUnknownState)
List<Stage> getFirstStageInProgressPerRequest()
getCommandsInProgressCount()
in order to determine if there
are stages that are in progress before getting the stages from this method.HostRoleStatus.IN_PROGRESS_STATUSES
List<Stage> getStagesInProgressForRequest(Long requestId)
getCommandsInProgressCount()
in
order to determine if there are stages that are in progress before getting
the stages from this method.HostRoleStatus.IN_PROGRESS_STATUSES
int getCommandsInProgressCount()
void persistActions(Request request) throws org.apache.ambari.server.AmbariException
request
- request objectorg.apache.ambari.server.AmbariException
void startRequest(long requestId)
void endRequest(long requestId)
void setSourceScheduleForRequest(long requestId, long scheduleId)
void updateHostRoleStates(Collection<CommandReport> reports)
void updateHostRoleState(String hostname, long requestId, long stageId, String role, CommandReport report)
void abortHostRole(String host, long requestId, long stageId, String role)
void abortHostRole(String host, long requestId, long stageId, String role, String reason)
long getLastPersistedRequestIdWhenInitialized()
void bulkHostRoleScheduled(Stage s, List<ExecutionCommand> commands)
void bulkAbortHostRole(Stage s, Map<ExecutionCommand,String> commands)
void hostRoleScheduled(Stage s, String hostname, String roleStr)
List<HostRoleCommand> getRequestTasks(long requestId)
List<HostRoleCommand> getAllTasksByRequestIds(Collection<Long> requestIds)
Collection<HostRoleCommand> getTasks(Collection<Long> taskIds)
List<HostRoleCommand> getTasksByHostRoleAndStatus(String hostname, String role, HostRoleStatus status)
List<HostRoleCommand> getTasksByRoleAndStatus(String role, HostRoleStatus status)
HostRoleCommand getTask(long taskId)
List<Long> getRequestsByStatus(RequestStatus status, int maxResults, boolean ascOrder)
status
- Desired request statusmaxResults
- maximal number of returned id'sascOrder
- defines sorting order for database query resultMap<Long,String> getRequestContext(List<Long> requestIds)
String getRequestContext(long requestId)
List<Request> getRequests(Collection<Long> requestIds)
Copyright © 2022 Apache Software Foundation. All rights reserved.