| Constructor and Description |
|---|
HostImpl(HostEntity hostEntity,
boolean persisted,
com.google.inject.Injector injector) |
| 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 a map of configType with all applicable config tags.
|
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()
Shows if Host is persisted to database
|
void |
persist()
Save host to database and make all changes to be saved afterwards
|
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.
|
@Inject public HostImpl(HostEntity hostEntity, boolean persisted, com.google.inject.Injector injector)
public void importHostInfo(HostInfo hostInfo)
importHostInfo in interface HosthostInfo - public void setLastAgentEnv(AgentEnv env)
HostsetLastAgentEnv in interface Hostpublic AgentEnv getLastAgentEnv()
HostgetLastAgentEnv in interface Hostpublic void setState(HostState state)
Hostpublic void handleEvent(HostEvent event) throws InvalidStateTransitionException
HosthandleEvent in interface Hostevent - HostEventInvalidStateTransitionExceptionpublic String getHostName()
getHostName in interface Hostpublic void setHostName(String hostName)
setHostName in interface HosthostName - the hostName to setpublic Integer getCurrentPingPort()
getCurrentPingPort in interface Hostpublic void setCurrentPingPort(Integer currentPingPort)
setCurrentPingPort in interface HostcurrentPingPort - the currentPingPort to setpublic void setPublicHostName(String hostName)
HostsetPublicHostName in interface Hostpublic String getPublicHostName()
HostgetPublicHostName in interface Hostpublic void setIPv4(String ip)
public void setIPv6(String ip)
public int getCpuCount()
getCpuCount in interface Hostpublic void setCpuCount(int cpuCount)
setCpuCount in interface HostcpuCount - the cpuCount to setpublic int getPhCpuCount()
getPhCpuCount in interface Hostpublic void setPhCpuCount(int phCpuCount)
setPhCpuCount in interface HostphCpuCount - the physical cpu cores to setpublic long getTotalMemBytes()
HostgetTotalMemBytes in interface Hostpublic void setTotalMemBytes(long totalMemBytes)
HostsetTotalMemBytes in interface HosttotalMemBytes - the totalMemBytes to setpublic long getAvailableMemBytes()
HostgetAvailableMemBytes in interface Hostpublic void setAvailableMemBytes(long availableMemBytes)
HostsetAvailableMemBytes in interface HostavailableMemBytes - the availableMemBytes to setpublic String getOsArch()
Hostpublic void setOsArch(String osArch)
public String getOsInfo()
Hostpublic void setOsInfo(String osInfo)
public String getOsType()
Hostpublic void setOsType(String osType)
public List<DiskInfo> getDisksInfo()
HostgetDisksInfo in interface Hostpublic void setDisksInfo(List<DiskInfo> disksInfo)
setDisksInfo in interface HostdisksInfo - the disksInfo to setpublic HostHealthStatus getHealthStatus()
getHealthStatus in interface Hostpublic void setHealthStatus(HostHealthStatus healthStatus)
setHealthStatus in interface HosthealthStatus - the healthStatus to setpublic Map<String,String> getHostAttributes()
HostgetHostAttributes in interface Hostpublic void setHostAttributes(Map<String,String> hostAttributes)
setHostAttributes in interface HosthostAttributes - the hostAttributes to setpublic String getRackInfo()
getRackInfo in interface Hostpublic void setRackInfo(String rackInfo)
setRackInfo in interface HostrackInfo - the rackInfo to setpublic long getLastRegistrationTime()
HostgetLastRegistrationTime in interface Hostpublic void setLastRegistrationTime(long lastRegistrationTime)
setLastRegistrationTime in interface HostlastRegistrationTime - the lastRegistrationTime to setpublic long getLastHeartbeatTime()
HostgetLastHeartbeatTime in interface Hostpublic void setLastHeartbeatTime(long lastHeartbeatTime)
setLastHeartbeatTime in interface HostlastHeartbeatTime - the lastHeartbeatTime to setpublic AgentVersion getAgentVersion()
HostgetAgentVersion in interface Hostpublic void setAgentVersion(AgentVersion agentVersion)
setAgentVersion in interface HostagentVersion - the agentVersion to setpublic long getTimeInState()
HostgetTimeInState in interface Hostpublic void setTimeInState(long timeInState)
setTimeInState in interface HosttimeInState - the timeInState to setpublic void setStatus(String status)
Hostpublic HostResponse convertToResponse()
convertToResponse in interface Hostpublic boolean isPersisted()
isPersisted in interface Hostpublic void persist()
public boolean addDesiredConfig(long clusterId,
boolean selected,
String user,
Config config)
HostaddDesiredConfig in interface HostclusterId - 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 currentpublic Map<String,DesiredConfig> getDesiredConfigs(long clusterId)
HostDesiredConfig instances.getDesiredConfigs in interface Hostpublic Map<String,HostConfig> getDesiredHostConfigs(Cluster cluster) throws AmbariException
getDesiredHostConfigs in interface Hostcluster - AmbariExceptionpublic void setMaintenanceState(long clusterId,
MaintenanceState state)
HostsetMaintenanceState in interface HostclusterId - the cluster idstate - the statepublic MaintenanceState getMaintenanceState(long clusterId)
getMaintenanceState in interface HostclusterId - the cluster idCopyright © 2016. All rights reserved.