Class Component
java.lang.Object
org.apache.hadoop.yarn.service.api.records.Component
- All Implemented Interfaces:
Serializable
One or more components of the service. If the service is HBase say,
then the component can be a simple role like master or regionserver. If the
service is a complex business webapp then a component can be other
services say Kafka or Storm. Thereby it opens up the support for complex
and nested services.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPolicy of restart component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContainer(Container container) voidaddDecommissionedInstance(String componentInstanceName) Artifact of the component (optional).configuration(Configuration configuration) Config properties for this component.decommissionedInstances(List<String> decommissionedInstances) A list of decommissioned component instances.dependencies(List<String> dependencies) An array of service components which should be in READY state (as defined by readiness check), before this component can be started.booleangetComponentInstance(String compInstanceName) getContainer(String id) getName()Policy of restart component.getState()inthashCode()launchCommand(String launchCommand) The custom launch command of this component (optional).voidMerge from another component into this component without overwriting.Name of the service component (mandatory).numberOfContainers(Long numberOfContainers) Number of containers for this component (optional).voidplacementPolicy(PlacementPolicy placementPolicy) Advanced scheduling and placement policies for all containers of this component.quicklinks(List<String> quicklinks) A list of quicklink keys defined at the service level, and to be resolved by this component.readinessCheck(ReadinessCheck readinessCheck) Readiness check for this component.voidremoveContainer(Container container) Resource of this component (optional).restartPolicy(Component.RestartPolicyEnum restartPolicyEnumVal) runPrivilegedContainer(Boolean runPrivilegedContainer) Run all containers of this component in privileged mode (YARN-4262).voidsetArtifact(Artifact artifact) voidsetConfiguration(Configuration configuration) voidsetContainers(List<Container> containers) voidsetDecommissionedInstances(List<String> decommissionedInstances) voidsetDependencies(List<String> dependencies) voidsetLaunchCommand(String launchCommand) voidvoidsetNumberOfContainers(Long numberOfContainers) voidsetPlacementPolicy(PlacementPolicy placementPolicy) voidsetQuicklinks(List<String> quicklinks) voidsetReadinessCheck(ReadinessCheck readinessCheck) voidsetResource(Resource resource) voidsetRestartPolicy(Component.RestartPolicyEnum restartPolicy) voidsetRunPrivilegedContainer(Boolean runPrivilegedContainer) voidsetState(ComponentState state) state(ComponentState state) toString()
-
Constructor Details
-
Component
public Component()
-
-
Method Details
-
restartPolicy
-
getRestartPolicy
Policy of restart component. Including ALWAYS (Always restart component instance even if instance exit code = 0); ON_FAILURE (Only restart component instance if instance exit code != 0); NEVER (Do not restart in any cases)- Returns:
- restartPolicy
-
setRestartPolicy
-
name
Name of the service component (mandatory). -
getName
-
setName
-
dependencies
An array of service components which should be in READY state (as defined by readiness check), before this component can be started. The dependencies across all components of a service should be represented as a DAG. -
getDependencies
-
setDependencies
-
readinessCheck
Readiness check for this component. -
getReadinessCheck
-
setReadinessCheck
-
artifact
Artifact of the component (optional). If not specified, the service level global artifact takes effect. -
getArtifact
-
setArtifact
-
launchCommand
The custom launch command of this component (optional). When specified at the component level, it overrides the value specified at the global level (if any). -
getLaunchCommand
-
setLaunchCommand
-
resource
Resource of this component (optional). If not specified, the service level global resource takes effect. -
getResource
-
setResource
-
numberOfContainers
Number of containers for this component (optional). If not specified, the service level global number_of_containers takes effect. -
getNumberOfContainers
-
setNumberOfContainers
-
decommissionedInstances
A list of decommissioned component instances. -
getDecommissionedInstances
-
setDecommissionedInstances
-
addDecommissionedInstance
-
getContainers
-
setContainers
-
addContainer
-
removeContainer
-
getContainer
-
getComponentInstance
-
runPrivilegedContainer
Run all containers of this component in privileged mode (YARN-4262). -
getRunPrivilegedContainer
-
setRunPrivilegedContainer
-
placementPolicy
Advanced scheduling and placement policies for all containers of this component. -
getPlacementPolicy
-
setPlacementPolicy
-
configuration
Config properties for this component. -
getConfiguration
-
setConfiguration
-
quicklinks
A list of quicklink keys defined at the service level, and to be resolved by this component. -
getQuicklinks
-
setQuicklinks
-
state
-
getState
-
setState
-
equals
-
hashCode
public int hashCode() -
toString
-
mergeFrom
Merge from another component into this component without overwriting. -
overwrite
-