public interface Host
Modifier and Type | Method and Description |
---|---|
boolean |
addDesiredConfig(long clusterId,
boolean selected,
String user,
Config config)
Adds a desired configuration to the host instance.
|
HostResponse |
convertToResponse() |
AgentVersion |
getAgentVersion()
Version of the Ambari Agent running on the host
|
long |
getAvailableMemBytes()
Get the Amount of available memory for the Host.
|
int |
getCpuCount() |
Integer |
getCurrentPingPort() |
Map<String,DesiredConfig> |
getDesiredConfigs(long clusterId)
Gets all the selected configurations for the host.
|
Map<String,HostConfig> |
getDesiredHostConfigs(Cluster cluster)
Get the desired configurations for the host including overrides
|
List<DiskInfo> |
getDisksInfo()
Get information on disks available on the host.
|
HostHealthStatus |
getHealthStatus() |
Map<String,String> |
getHostAttributes()
Get additional host attributes
For example, public/hostname/IP for AWS
|
String |
getHostName() |
String |
getIPv4()
IPv4 assigned to the Host
|
String |
getIPv6()
IPv6 assigned to the Host
|
AgentEnv |
getLastAgentEnv()
Gets the latest agent environment that arrived in a heartbeat.
|
long |
getLastHeartbeatTime()
Last time the Ambari Server received a heartbeat from the Host
( Unix timestamp )
|
long |
getLastRegistrationTime()
Last time the host registered with the Ambari Server
( Unix timestamp )
|
MaintenanceState |
getMaintenanceState(long clusterId) |
String |
getOsArch()
Get the OS Architecture.
|
String |
getOsInfo()
Get the General OS information.
|
String |
getOsType()
Get the OS Type: RHEL5/RHEL6/CentOS5/...
|
int |
getPhCpuCount() |
String |
getPublicHostName()
Sets the public-facing host name.
|
String |
getRackInfo() |
HostState |
getState()
Get Current Host State
|
String |
getStatus()
Get Current Host Status
|
long |
getTimeInState()
Get time spent in the current state i.e.
|
long |
getTotalMemBytes()
Get the Amount of physical memory for the Host.
|
void |
handleEvent(HostEvent event)
Send an event to the Host's StateMachine
|
void |
importHostInfo(HostInfo hostInfo) |
boolean |
isPersisted() |
void |
persist() |
void |
refresh() |
void |
setAgentVersion(AgentVersion agentVersion) |
void |
setAvailableMemBytes(long availableMemBytes)
Set the Amount of available memory for the Host.
|
void |
setCpuCount(int cpuCount) |
void |
setCurrentPingPort(Integer currentPingPort) |
void |
setDisksInfo(List<DiskInfo> disksInfo) |
void |
setHealthStatus(HostHealthStatus healthStatus) |
void |
setHostAttributes(Map<String,String> hostAttributes) |
void |
setHostName(String hostName) |
void |
setIPv4(String ip) |
void |
setIPv6(String ip) |
void |
setLastAgentEnv(AgentEnv env)
Sets the latest agent environment that arrived in a heartbeat.
|
void |
setLastHeartbeatTime(long lastHeartbeatTime) |
void |
setLastRegistrationTime(long lastRegistrationTime) |
void |
setMaintenanceState(long clusterId,
MaintenanceState state)
Sets the maintenance state for the host.
|
void |
setOsArch(String osArch) |
void |
setOsInfo(String osInfo) |
void |
setOsType(String osType) |
void |
setPhCpuCount(int phCpuCount) |
void |
setPublicHostName(String hostName)
Gets the public-facing host name.
|
void |
setRackInfo(String rackInfo) |
void |
setState(HostState state)
Set the State of the Host
|
void |
setStatus(String status)
Set the Status of the Host
|
void |
setTimeInState(long timeInState) |
void |
setTotalMemBytes(long totalMemBytes)
Set the Amount of physical memory for the Host.
|
String getHostName()
void setHostName(String hostName)
hostName
- the hostName to setInteger getCurrentPingPort()
void setCurrentPingPort(Integer currentPingPort)
currentPingPort
- the currentPingPort to setvoid setPublicHostName(String hostName)
String getPublicHostName()
String getIPv4()
void setIPv4(String ip)
ip
- the ip to setString getIPv6()
void setIPv6(String ip)
ip
- the ip to setint getCpuCount()
void setCpuCount(int cpuCount)
cpuCount
- the cpuCount to setint getPhCpuCount()
void setPhCpuCount(int phCpuCount)
phCpuCount
- the physical cpu cores to setlong getTotalMemBytes()
void setTotalMemBytes(long totalMemBytes)
totalMemBytes
- the totalMemBytes to setlong getAvailableMemBytes()
void setAvailableMemBytes(long availableMemBytes)
availableMemBytes
- the availableMemBytes to setString getOsArch()
void setOsArch(String osArch)
osArch
- the osArch to setString getOsInfo()
void setOsInfo(String osInfo)
osInfo
- the osInfo to setString getOsType()
void setOsType(String osType)
osType
- the osType to setList<DiskInfo> getDisksInfo()
void setDisksInfo(List<DiskInfo> disksInfo)
disksInfo
- the disksInfo to setHostHealthStatus getHealthStatus()
void setHealthStatus(HostHealthStatus healthStatus)
healthStatus
- the healthStatus to setMap<String,String> getHostAttributes()
void setHostAttributes(Map<String,String> hostAttributes)
hostAttributes
- the hostAttributes to setString getRackInfo()
void setRackInfo(String rackInfo)
rackInfo
- the rackInfo to setlong getLastRegistrationTime()
void setLastRegistrationTime(long lastRegistrationTime)
lastRegistrationTime
- the lastRegistrationTime to setlong getLastHeartbeatTime()
void setLastHeartbeatTime(long lastHeartbeatTime)
lastHeartbeatTime
- the lastHeartbeatTime to setvoid setLastAgentEnv(AgentEnv env)
AgentEnv getLastAgentEnv()
AgentVersion getAgentVersion()
void setAgentVersion(AgentVersion agentVersion)
agentVersion
- the agentVersion to setHostState getState()
void setState(HostState state)
state
- Host Statevoid handleEvent(HostEvent event) throws InvalidStateTransitionException
event
- HostEventInvalidStateTransitionException
long getTimeInState()
void setTimeInState(long timeInState)
timeInState
- the timeInState to setString getStatus()
void setStatus(String status)
status
- Host StatusHostResponse convertToResponse()
boolean isPersisted()
void persist()
void refresh()
void importHostInfo(HostInfo hostInfo)
boolean addDesiredConfig(long clusterId, boolean selected, String user, Config config)
clusterId
- the cluster id that the config applies toselected
- true
if the configuration is selected. Applies
only to remove the override, otherwise this value should always be true
.user
- the user making the change for audit purposesconfig
- the configuration objecttrue
if the config was added, or false
if the config is already set as the currentMap<String,DesiredConfig> getDesiredConfigs(long clusterId)
DesiredConfig
instances.Map<String,HostConfig> getDesiredHostConfigs(Cluster cluster) throws AmbariException
cluster
- AmbariException
void setMaintenanceState(long clusterId, MaintenanceState state)
clusterId
- the cluster idstate
- the stateMaintenanceState getMaintenanceState(long clusterId)
clusterId
- the cluster idCopyright © 2017. All rights reserved.