public class TopologyManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
INITIAL_CONFIG_TAG |
static String |
INTERNAL_AUTH_TOKEN
internal token for topology related async tasks
|
static String |
KDC_ADMIN_CREDENTIAL |
static String |
TOPOLOGY_RESOLVED_TAG |
Constructor and Description |
---|
TopologyManager() |
TopologyManager(Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
protected LogicalRequest |
createLogicalRequest(PersistedTopologyRequest request,
ClusterTopology topology,
Long requestId) |
ClusterTopology |
getClusterTopology(Long clusterId) |
Map<String,Collection<String>> |
getPendingHostComponents()
Gets a map of components keyed by host which have operations in the
HostRoleStatus.PENDING state. |
LogicalRequest |
getRequest(long requestId) |
Collection<LogicalRequest> |
getRequests(Collection<Long> requestIds) |
Collection<RequestStatusResponse> |
getRequestStatus(Collection<Long> ids) |
RequestStatusResponse |
getRequestStatus(long requestId) |
Collection<StageEntity> |
getStages()
Currently we are just returning all stages for all requests
and relying on the StageResourceProvider to convert each to a resource and do a predicate eval on each.
|
Map<Long,HostRoleCommandStatusSummaryDTO> |
getStageSummaries(Long requestId) |
Collection<HostRoleCommand> |
getTasks(Collection<Long> requestIds) |
Collection<HostRoleCommand> |
getTasks(long requestId) |
boolean |
isClusterProvisionWithBlueprintFinished(long clusterId)
Returns if the provision request for a cluster is finished.
|
boolean |
isClusterProvisionWithBlueprintTracked(long clusterId)
Returns if provision request for a cluster is tracked
|
void |
onClusterConfigFinishedEvent(ClusterConfigFinishedEvent event) |
void |
onHostHeartBeatLost(Host host)
Through this method
TopologyManager gets notified when a connection to a host in the cluster is lost. |
void |
onHostRegistered(HostImpl host,
boolean associatedWithCluster) |
void |
onRequestFinished(RequestFinishedEvent event)
Called when heartbeat processing finishes
|
protected void |
persistTopologyHostRegistration(long hostRequestId,
HostImpl host) |
protected LogicalRequest |
processAndPersistProvisionClusterTopologyRequest(ProvisionClusterRequest request,
ClusterTopology topology,
Long logicalRequestId)
Creates and persists a
PersistedTopologyRequest and a LogicalRequest for the provided
provision cluster request and topology. |
protected LogicalRequest |
processAndPersistTopologyRequest(BaseClusterRequest request,
ClusterTopology topology,
Long logicalRequestId)
Creates and persists a
PersistedTopologyRequest and a LogicalRequest for the provided request and topology. |
void |
processHostRemovedEvent(HostsRemovedEvent hostsRemovedEvent)
Removes a host from the available hosts when the host gets deleted.
|
RequestStatusResponse |
provisionCluster(ProvisionClusterRequest request) |
void |
removeHostRequests(String hostName)
Removes topology host requests matched to the given host.
|
void |
removePendingHostRequests(String clusterName,
long requestId) |
RequestStatusResponse |
scaleHosts(ScaleClusterRequest request) |
public static final String INTERNAL_AUTH_TOKEN
public static final String INITIAL_CONFIG_TAG
public static final String TOPOLOGY_RESOLVED_TAG
public static final String KDC_ADMIN_CREDENTIAL
public TopologyManager()
@Inject public TopologyManager(Configuration configuration)
public void onRequestFinished(RequestFinishedEvent event)
event
- public boolean isClusterProvisionWithBlueprintTracked(long clusterId)
clusterId
- public boolean isClusterProvisionWithBlueprintFinished(long clusterId)
isClusterProvisionWithBlueprintTracked(long)
clusterId
- public RequestStatusResponse provisionCluster(ProvisionClusterRequest request) throws InvalidTopologyException, org.apache.ambari.server.AmbariException
InvalidTopologyException
org.apache.ambari.server.AmbariException
public void onClusterConfigFinishedEvent(ClusterConfigFinishedEvent event)
public RequestStatusResponse scaleHosts(ScaleClusterRequest request) throws InvalidTopologyException, org.apache.ambari.server.AmbariException
InvalidTopologyException
org.apache.ambari.server.AmbariException
public void removePendingHostRequests(String clusterName, long requestId)
public void removeHostRequests(String hostName)
hostName
- the host name for which requests should be removedprotected LogicalRequest processAndPersistProvisionClusterTopologyRequest(ProvisionClusterRequest request, ClusterTopology topology, Long logicalRequestId) throws InvalidTopologyException, org.apache.ambari.server.AmbariException
PersistedTopologyRequest
and a LogicalRequest
for the provided
provision cluster request and topology.request
- Provision cluster request to create a logical request for.topology
- Cluster topologylogicalRequestId
- The Id for the created logical requestInvalidTopologyException
org.apache.ambari.server.AmbariException
protected LogicalRequest processAndPersistTopologyRequest(BaseClusterRequest request, ClusterTopology topology, Long logicalRequestId) throws InvalidTopologyException, org.apache.ambari.server.AmbariException
PersistedTopologyRequest
and a LogicalRequest
for the provided request and topology.request
- ProvisionClusterRequest
or ScaleClusterRequest
to create a logical request for.topology
- Cluster topologylogicalRequestId
- The Id for the created logical requestInvalidTopologyException
org.apache.ambari.server.AmbariException
public void onHostRegistered(HostImpl host, boolean associatedWithCluster)
public void onHostHeartBeatLost(Host host)
TopologyManager
gets notified when a connection to a host in the cluster is lost.
The passed host will be excluded from scheduling any tasks onto it as it can't be reached.host
- public LogicalRequest getRequest(long requestId)
public Collection<LogicalRequest> getRequests(Collection<Long> requestIds)
public Collection<StageEntity> getStages()
public Collection<HostRoleCommand> getTasks(long requestId)
public Collection<HostRoleCommand> getTasks(Collection<Long> requestIds)
public Map<Long,HostRoleCommandStatusSummaryDTO> getStageSummaries(Long requestId)
public RequestStatusResponse getRequestStatus(long requestId)
public Collection<RequestStatusResponse> getRequestStatus(Collection<Long> ids)
public ClusterTopology getClusterTopology(Long clusterId)
public Map<String,Collection<String>> getPendingHostComponents()
HostRoleStatus.PENDING
state. This could either be because hosts
have not registered or becuase the operations are actually waiting to be
queued.protected LogicalRequest createLogicalRequest(PersistedTopologyRequest request, ClusterTopology topology, Long requestId) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
protected void persistTopologyHostRegistration(long hostRequestId, HostImpl host)
public void processHostRemovedEvent(HostsRemovedEvent hostsRemovedEvent)
hostsRemovedEvent
- the event containing the hostnameCopyright © 2022 Apache Software Foundation. All rights reserved.