public class ActionManager extends Object
Constructor and Description |
---|
ActionManager(ActionDBAccessor db,
RequestFactory requestFactory,
org.apache.ambari.server.actionmanager.ActionScheduler scheduler)
Guice-injected Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelRequest(long requestId,
String reason) |
Stage |
getAction(long requestId,
long stageId) |
List<Stage> |
getActions(long requestId)
Get all actions(stages) for a request.
|
List<HostRoleCommand> |
getAllTasksByRequestIds(Collection<Long> requestIds) |
long |
getNextRequestId() |
Map<Long,String> |
getRequestContext(List<Long> requestIds) |
String |
getRequestContext(long requestId) |
List<Request> |
getRequests(Collection<Long> requestIds) |
List<Long> |
getRequestsByStatus(RequestStatus status,
int maxResults,
boolean ascOrder)
Get first or last maxResults requests that are in the specified status
|
List<Stage> |
getRequestStatus(long requestId) |
List<HostRoleCommand> |
getRequestTasks(long requestId) |
HostRoleCommand |
getTaskById(long taskId) |
Collection<HostRoleCommand> |
getTasks(Collection<Long> taskIds) |
Map<Long,HostRoleCommand> |
getTasksMap(Collection<Long> taskIds) |
void |
handleLostHost(String host) |
boolean |
isInProgressCommand(CommandReport report)
Find if the command report is for an in progress command
|
void |
processTaskResponse(String hostname,
List<CommandReport> reports,
Map<Long,HostRoleCommand> commands)
Persists command reports into the db
|
void |
resubmitTasks(List<Long> taskIds) |
void |
sendActions(List<Stage> stages,
String clusterHostInfo,
ExecuteActionRequest actionRequest) |
void |
sendActions(Request request,
ExecuteActionRequest executeActionRequest) |
static void |
setTopologyManager(TopologyManager topologyManager) |
void |
shutdown() |
void |
start() |
@Inject public ActionManager(ActionDBAccessor db, RequestFactory requestFactory, org.apache.ambari.server.actionmanager.ActionScheduler scheduler)
db
- requestFactory
- scheduler
- public void start()
public void shutdown()
public void sendActions(List<Stage> stages, String clusterHostInfo, ExecuteActionRequest actionRequest) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public void sendActions(Request request, ExecuteActionRequest executeActionRequest) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public List<Request> getRequests(Collection<Long> requestIds)
public Stage getAction(long requestId, long stageId)
public List<Stage> getActions(long requestId)
requestId
- the request idpublic HostRoleCommand getTaskById(long taskId)
public void processTaskResponse(String hostname, List<CommandReport> reports, Map<Long,HostRoleCommand> commands)
reports
- command reportscommands
- a list of commands that correspond to reports list (it should be
a 1 to 1 matching). We use this list to avoid fetching commands from the DB
twicepublic boolean isInProgressCommand(CommandReport report)
report
- public void handleLostHost(String host)
public long getNextRequestId()
public List<HostRoleCommand> getRequestTasks(long requestId)
public List<HostRoleCommand> getAllTasksByRequestIds(Collection<Long> requestIds)
public Collection<HostRoleCommand> getTasks(Collection<Long> taskIds)
public Map<Long,HostRoleCommand> getTasksMap(Collection<Long> taskIds)
public 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 resultpublic String getRequestContext(long requestId)
public void cancelRequest(long requestId, String reason)
public static void setTopologyManager(TopologyManager topologyManager)
Copyright © 2022 Apache Software Foundation. All rights reserved.