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

@Public @Unstable public class Service extends BaseResource
An Service resource has the following attributes.
See Also:
  • Constructor Details

    • Service

      public Service()
  • Method Details

    • name

      public Service name(String name)
      A unique service name.
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • id

      public Service id(String id)
      A unique service id.
    • getId

      public String getId()
    • setId

      public void setId(String id)
    • getVersion

      public String getVersion()
    • setVersion

      public void setVersion(String version)
    • version

      public Service version(String version)
      Version of the service.
    • getDescription

      public String getDescription()
    • setDescription

      public void setDescription(String description)
    • description

      public Service description(String description)
      Description of the service.
    • artifact

      public Service artifact(Artifact artifact)
      Artifact of single-component services. Mandatory if components attribute is not specified.
    • getArtifact

      public Artifact getArtifact()
    • setArtifact

      public void setArtifact(Artifact artifact)
    • resource

      public Service resource(Resource resource)
      Resource of single-component services or the global default for multi-component services. Mandatory if it is a single-component service and if cpus and memory are not specified at the Service level.
    • getResource

      public Resource getResource()
    • setResource

      public void setResource(Resource resource)
    • launchTime

      public Service launchTime(Date launchTime)
      The time when the service was created, e.g. 2016-03-16T01:01:49.000Z.
    • getLaunchTime

      public Date getLaunchTime()
    • setLaunchTime

      public void setLaunchTime(Date launchTime)
    • numberOfRunningContainers

      public Service numberOfRunningContainers(Long numberOfRunningContainers)
      In get response this provides the total number of running containers for this service (across all components) at the time of request. Note, a subsequent request can return a different number as and when more containers get allocated until it reaches the total number of containers or if a flex request has been made between the two requests.
    • getNumberOfRunningContainers

      public Long getNumberOfRunningContainers()
    • setNumberOfRunningContainers

      public void setNumberOfRunningContainers(Long numberOfRunningContainers)
    • lifetime

      public Service lifetime(Long lifetime)
      Life time (in seconds) of the service from the time it reaches the RUNNING_BUT_UNREADY state (after which it is automatically destroyed by YARN). For unlimited lifetime do not set a lifetime value.
    • getLifetime

      public Long getLifetime()
    • setLifetime

      public void setLifetime(Long lifetime)
    • components

      public Service components(List<Component> components)
      Components of an service.
    • getComponents

      public List<Component> getComponents()
    • setComponents

      public void setComponents(List<Component> components)
    • addComponent

      public void addComponent(Component component)
    • getComponent

      public Component getComponent(String name)
    • configuration

      public Service configuration(Configuration configuration)
      Config properties of an service. Configurations provided at the service/global level are available to all the components. Specific properties can be overridden at the component level.
    • getConfiguration

      public Configuration getConfiguration()
    • setConfiguration

      public void setConfiguration(Configuration configuration)
    • state

      public Service state(ServiceState state)
      State of the service. Specifying a value for this attribute for the POST payload raises a validation error. This attribute is available only in the GET response of a started service.
    • getState

      public ServiceState getState()
    • setState

      public void setState(ServiceState state)
    • quicklinks

      public Service quicklinks(Map<String,String> quicklinks)
      A blob of key-value pairs of quicklinks to be exported for an service.
    • getQuicklinks

      public Map<String,String> getQuicklinks()
    • setQuicklinks

      public void setQuicklinks(Map<String,String> quicklinks)
    • queue

      public Service queue(String queue)
      The YARN queue that this service should be submitted to.
    • getQueue

      public String getQueue()
    • setQueue

      public void setQueue(String queue)
    • getDependencies

      public List<String> getDependencies()
    • setDependencies

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

      public Service kerberosPrincipal(KerberosPrincipal kerberosPrincipal)
    • getKerberosPrincipal

      public KerberosPrincipal getKerberosPrincipal()
      The Kerberos Principal of the service.
      Returns:
      kerberosPrincipal
    • setKerberosPrincipal

      public void setKerberosPrincipal(KerberosPrincipal kerberosPrincipal)
    • dockerClientConfig

      public Service dockerClientConfig(String dockerClientConfig)
    • getDockerClientConfig

      public String getDockerClientConfig()
      The Docker client config for the service.
      Returns:
      dockerClientConfig
    • setDockerClientConfig

      public void setDockerClientConfig(String dockerClientConfig)
    • 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 BaseResource