java.lang.Object
org.apache.hadoop.yarn.service.api.records.Component
All Implemented Interfaces:
Serializable

@Public @Unstable public class Component extends Object implements 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:
  • Constructor Details

    • Component

      public Component()
  • Method Details

    • restartPolicy

      public Component restartPolicy(Component.RestartPolicyEnum restartPolicyEnumVal)
    • getRestartPolicy

      public Component.RestartPolicyEnum 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

      public void setRestartPolicy(Component.RestartPolicyEnum restartPolicy)
    • name

      public Component name(String name)
      Name of the service component (mandatory).
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • dependencies

      public Component 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. The dependencies across all components of a service should be represented as a DAG.
    • getDependencies

      public List<String> getDependencies()
    • setDependencies

      public void setDependencies(List<String> dependencies)
    • readinessCheck

      public Component readinessCheck(ReadinessCheck readinessCheck)
      Readiness check for this component.
    • getReadinessCheck

      public ReadinessCheck getReadinessCheck()
    • setReadinessCheck

      public void setReadinessCheck(ReadinessCheck readinessCheck)
    • artifact

      public Component artifact(Artifact artifact)
      Artifact of the component (optional). If not specified, the service level global artifact takes effect.
    • getArtifact

      public Artifact getArtifact()
    • setArtifact

      public void setArtifact(Artifact artifact)
    • launchCommand

      public Component launchCommand(String 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

      public String getLaunchCommand()
    • setLaunchCommand

      public void setLaunchCommand(String launchCommand)
    • resource

      public Component resource(Resource resource)
      Resource of this component (optional). If not specified, the service level global resource takes effect.
    • getResource

      public Resource getResource()
    • setResource

      public void setResource(Resource resource)
    • numberOfContainers

      public Component numberOfContainers(Long numberOfContainers)
      Number of containers for this component (optional). If not specified, the service level global number_of_containers takes effect.
    • getNumberOfContainers

      public Long getNumberOfContainers()
    • setNumberOfContainers

      public void setNumberOfContainers(Long numberOfContainers)
    • decommissionedInstances

      public Component decommissionedInstances(List<String> decommissionedInstances)
      A list of decommissioned component instances.
    • getDecommissionedInstances

      public List<String> getDecommissionedInstances()
    • setDecommissionedInstances

      public void setDecommissionedInstances(List<String> decommissionedInstances)
    • addDecommissionedInstance

      public void addDecommissionedInstance(String componentInstanceName)
    • getContainers

      public List<Container> getContainers()
    • setContainers

      public void setContainers(List<Container> containers)
    • addContainer

      public void addContainer(Container container)
    • removeContainer

      public void removeContainer(Container container)
    • getContainer

      public Container getContainer(String id)
    • getComponentInstance

      public Container getComponentInstance(String compInstanceName)
    • runPrivilegedContainer

      public Component runPrivilegedContainer(Boolean runPrivilegedContainer)
      Run all containers of this component in privileged mode (YARN-4262).
    • getRunPrivilegedContainer

      public Boolean getRunPrivilegedContainer()
    • setRunPrivilegedContainer

      public void setRunPrivilegedContainer(Boolean runPrivilegedContainer)
    • placementPolicy

      public Component placementPolicy(PlacementPolicy placementPolicy)
      Advanced scheduling and placement policies for all containers of this component.
    • getPlacementPolicy

      public PlacementPolicy getPlacementPolicy()
    • setPlacementPolicy

      public void setPlacementPolicy(PlacementPolicy placementPolicy)
    • configuration

      public Component configuration(Configuration configuration)
      Config properties for this component.
    • getConfiguration

      public Configuration getConfiguration()
    • setConfiguration

      public void setConfiguration(Configuration configuration)
    • quicklinks

      public Component quicklinks(List<String> quicklinks)
      A list of quicklink keys defined at the service level, and to be resolved by this component.
    • getQuicklinks

      public List<String> getQuicklinks()
    • setQuicklinks

      public void setQuicklinks(List<String> quicklinks)
    • state

      public Component state(ComponentState state)
    • getState

      public ComponentState getState()
    • setState

      public void setState(ComponentState state)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • mergeFrom

      public void mergeFrom(Component that)
      Merge from another component into this component without overwriting.
    • overwrite

      public void overwrite(Component that)