public class MaintenanceModeEvent extends AmbariEvent
MaintenanceModeEvent
is used to capture a host/service/component
maintenance mode change and broadcast it to the system.
Although there are several different states aside from on & off in
MaintenanceState
, this event should handle explicit on or off state
changes. This event should not be used for implied state changes, such as
when a component goes into implied maintenance mode as a result of its host's
maintenance mode being explicitely invoked.AmbariEvent.AmbariEventType
m_eventType
Constructor and Description |
---|
MaintenanceModeEvent(MaintenanceState state,
long clusterId,
Host host)
Constructor.
|
MaintenanceModeEvent(MaintenanceState state,
Service service)
Constructor.
|
MaintenanceModeEvent(MaintenanceState state,
ServiceComponentHost serviceComponentHost)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
long |
getClusterId()
Gets the cluster id for the host, service or component
that had the direct maintenance mode event,.
|
Host |
getHost()
Gets the host that had the direct maintenance mode event, or
null
if the event was not directly on a host. |
MaintenanceState |
getMaintenanceState()
Gets the new maintenance state for the service/host/component.
|
Service |
getService()
Gets the service that had the direct maintenance mode event, or
null if the event was not directly on a service. |
ServiceComponentHost |
getServiceComponentHost()
Gets the component that had the direct maintenance mode event, or
null if the event was not directly on a component. |
String |
toString() |
getType
public MaintenanceModeEvent(MaintenanceState state, Service service)
state
- the new state (not null
).service
- the service that changed maintenance state (not null
)).public MaintenanceModeEvent(MaintenanceState state, long clusterId, Host host)
state
- the new state (not null
).clusterId
- the cluster to which the host belongs to (not -1
).host
- the host that changed maintenance state (not null
)).public MaintenanceModeEvent(MaintenanceState state, ServiceComponentHost serviceComponentHost)
state
- the new state (not null
).serviceComponentHost
- the component that changed maintenance state (not null
)).public Service getService()
null
if the event was not directly on a service.null
public Host getHost()
null
if the event was not directly on a host.null
public ServiceComponentHost getServiceComponentHost()
null
if the event was not directly on a component.null
public MaintenanceState getMaintenanceState()
null
).public long getClusterId()
public String toString()
toString
in class AmbariEvent
Copyright © 2022 Apache Software Foundation. All rights reserved.