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 Host
hostInfo
- public void setLastAgentEnv(AgentEnv env)
Host
setLastAgentEnv
in interface Host
public AgentEnv getLastAgentEnv()
Host
getLastAgentEnv
in interface Host
public void setState(HostState state)
Host
public void handleEvent(HostEvent event) throws InvalidStateTransitionException
Host
handleEvent
in interface Host
event
- HostEventInvalidStateTransitionException
public String getHostName()
getHostName
in interface Host
public void setHostName(String hostName)
setHostName
in interface Host
hostName
- the hostName to setpublic Integer getCurrentPingPort()
getCurrentPingPort
in interface Host
public void setCurrentPingPort(Integer currentPingPort)
setCurrentPingPort
in interface Host
currentPingPort
- the currentPingPort to setpublic void setPublicHostName(String hostName)
Host
setPublicHostName
in interface Host
public String getPublicHostName()
Host
getPublicHostName
in interface Host
public void setIPv4(String ip)
public void setIPv6(String ip)
public int getCpuCount()
getCpuCount
in interface Host
public void setCpuCount(int cpuCount)
setCpuCount
in interface Host
cpuCount
- the cpuCount to setpublic int getPhCpuCount()
getPhCpuCount
in interface Host
public void setPhCpuCount(int phCpuCount)
setPhCpuCount
in interface Host
phCpuCount
- the physical cpu cores to setpublic long getTotalMemBytes()
Host
getTotalMemBytes
in interface Host
public void setTotalMemBytes(long totalMemBytes)
Host
setTotalMemBytes
in interface Host
totalMemBytes
- the totalMemBytes to setpublic long getAvailableMemBytes()
Host
getAvailableMemBytes
in interface Host
public void setAvailableMemBytes(long availableMemBytes)
Host
setAvailableMemBytes
in interface Host
availableMemBytes
- the availableMemBytes to setpublic String getOsArch()
Host
public void setOsArch(String osArch)
public String getOsInfo()
Host
public void setOsInfo(String osInfo)
public String getOsType()
Host
public void setOsType(String osType)
public List<DiskInfo> getDisksInfo()
Host
getDisksInfo
in interface Host
public void setDisksInfo(List<DiskInfo> disksInfo)
setDisksInfo
in interface Host
disksInfo
- the disksInfo to setpublic HostHealthStatus getHealthStatus()
getHealthStatus
in interface Host
public void setHealthStatus(HostHealthStatus healthStatus)
setHealthStatus
in interface Host
healthStatus
- the healthStatus to setpublic Map<String,String> getHostAttributes()
Host
getHostAttributes
in interface Host
public void setHostAttributes(Map<String,String> hostAttributes)
setHostAttributes
in interface Host
hostAttributes
- the hostAttributes to setpublic String getRackInfo()
getRackInfo
in interface Host
public void setRackInfo(String rackInfo)
setRackInfo
in interface Host
rackInfo
- the rackInfo to setpublic long getLastRegistrationTime()
Host
getLastRegistrationTime
in interface Host
public void setLastRegistrationTime(long lastRegistrationTime)
setLastRegistrationTime
in interface Host
lastRegistrationTime
- the lastRegistrationTime to setpublic long getLastHeartbeatTime()
Host
getLastHeartbeatTime
in interface Host
public void setLastHeartbeatTime(long lastHeartbeatTime)
setLastHeartbeatTime
in interface Host
lastHeartbeatTime
- the lastHeartbeatTime to setpublic AgentVersion getAgentVersion()
Host
getAgentVersion
in interface Host
public void setAgentVersion(AgentVersion agentVersion)
setAgentVersion
in interface Host
agentVersion
- the agentVersion to setpublic long getTimeInState()
Host
getTimeInState
in interface Host
public void setTimeInState(long timeInState)
setTimeInState
in interface Host
timeInState
- the timeInState to setpublic void setStatus(String status)
Host
public HostResponse convertToResponse()
convertToResponse
in interface Host
public boolean isPersisted()
isPersisted
in interface Host
public void persist()
public boolean addDesiredConfig(long clusterId, boolean selected, String user, Config config)
Host
addDesiredConfig
in interface Host
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 currentpublic Map<String,DesiredConfig> getDesiredConfigs(long clusterId)
Host
DesiredConfig
instances.getDesiredConfigs
in interface Host
public Map<String,HostConfig> getDesiredHostConfigs(Cluster cluster) throws AmbariException
getDesiredHostConfigs
in interface Host
cluster
- AmbariException
public void setMaintenanceState(long clusterId, MaintenanceState state)
Host
setMaintenanceState
in interface Host
clusterId
- the cluster idstate
- the statepublic MaintenanceState getMaintenanceState(long clusterId)
getMaintenanceState
in interface Host
clusterId
- the cluster idCopyright © 2015. All rights reserved.