@Singleton public class PersistedStateImpl extends Object implements PersistedState
Constructor and Description |
---|
PersistedStateImpl() |
Modifier and Type | Method and Description |
---|---|
Map<ClusterTopology,List<LogicalRequest>> |
getAllRequests()
Get all persisted requests.
|
LogicalRequest |
getProvisionRequest(long clusterId)
Returns provision request for a cluster
|
void |
persistLogicalRequest(LogicalRequest logicalRequest,
long topologyRequestId)
Persist a logical request.
|
PersistedTopologyRequest |
persistTopologyRequest(BaseClusterRequest request)
Persist a topology request.
|
void |
registerHostName(long hostRequestId,
String hostName)
Registeer a host with a host request.
|
void |
registerInTopologyHostInfo(Host host) |
void |
registerPhysicalTask(long logicalTaskId,
long physicalTaskId)
Register a physical task with a logical task.
|
void |
removeHostRequests(long logicalRequestId,
Collection<HostRequest> hostRequests)
Remove the given host requests (must belong to the same topology request),
and also the topology request if it does not have any host requests left.
|
void |
setHostRequestStatus(long hostRequestId,
HostRoleStatus status,
String message)
Update the status of the given host request.
|
public PersistedTopologyRequest persistTopologyRequest(BaseClusterRequest request)
PersistedState
persistTopologyRequest
in interface PersistedState
request
- topology request to persistpublic void persistLogicalRequest(LogicalRequest logicalRequest, long topologyRequestId)
PersistedState
persistLogicalRequest
in interface PersistedState
logicalRequest
- logical request to persisttopologyRequestId
- the id of the associated topology requestpublic void removeHostRequests(long logicalRequestId, Collection<HostRequest> hostRequests)
PersistedState
removeHostRequests
in interface PersistedState
public void setHostRequestStatus(long hostRequestId, HostRoleStatus status, String message)
PersistedState
setHostRequestStatus
in interface PersistedState
public void registerPhysicalTask(long logicalTaskId, long physicalTaskId)
PersistedState
registerPhysicalTask
in interface PersistedState
logicalTaskId
- logical task idphysicalTaskId
- physical task idpublic void registerHostName(long hostRequestId, String hostName)
PersistedState
registerHostName
in interface PersistedState
hostRequestId
- host request idhostName
- name of host being registeredpublic void registerInTopologyHostInfo(Host host)
registerInTopologyHostInfo
in interface PersistedState
public LogicalRequest getProvisionRequest(long clusterId)
PersistedState
getProvisionRequest
in interface PersistedState
public Map<ClusterTopology,List<LogicalRequest>> getAllRequests()
PersistedState
getAllRequests
in interface PersistedState
Copyright © 2022 Apache Software Foundation. All rights reserved.