org.apache.hadoop.yarn.service.api.records

## Class Service

- java.lang.Object
- - org.apache.hadoop.yarn.service.api.records.BaseResource
  - - org.apache.hadoop.yarn.service.api.records.Service

- All Implemented Interfaces:
    Serializable

      @InterfaceAudience.Public
       @InterfaceStability.Unstable
      public class Service
      extends BaseResource

  An Service resource has the following attributes.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Service()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addComponent(Component component)`
    `Service` | `artifact(Artifact artifact)` Artifact of single-component services.
    `Service` | `components(List<Component> components)` Components of an service.
    `Service` | `configuration(Configuration configuration)` Config properties of an service.
    `Service` | `description(String description)` Description of the service.
    `Service` | `dockerClientConfig(String dockerClientConfig)`
    `boolean` | `equals(Object o)`
    `Artifact` | `getArtifact()`
    `Component` | `getComponent(String name)`
    `List<Component>` | `getComponents()`
    `Configuration` | `getConfiguration()`
    `List<String>` | `getDependencies()`
    `String` | `getDescription()`
    `String` | `getDockerClientConfig()` The Docker client config for the service.
    `String` | `getId()`
    `KerberosPrincipal` | `getKerberosPrincipal()` The Kerberos Principal of the service.
    `Date` | `getLaunchTime()`
    `Long` | `getLifetime()`
    `String` | `getName()`
    `Long` | `getNumberOfRunningContainers()`
    `String` | `getQueue()`
    `Map<String,String>` | `getQuicklinks()`
    `Resource` | `getResource()`
    `ServiceState` | `getState()`
    `String` | `getVersion()`
    `int` | `hashCode()`
    `Service` | `id(String id)` A unique service id.
    `Service` | `kerberosPrincipal(KerberosPrincipal kerberosPrincipal)`
    `Service` | `launchTime(Date launchTime)` The time when the service was created, e.g.
    `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).
    `Service` | `name(String name)` A unique service name.
    `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.
    `Service` | `queue(String queue)` The YARN queue that this service should be submitted to.
    `Service` | `quicklinks(Map<String,String> quicklinks)` A blob of key-value pairs of quicklinks to be exported for an service.
    `Service` | `resource(Resource resource)` Resource of single-component services or the global default for multi-component services.
    `void` | `setArtifact(Artifact artifact)`
    `void` | `setComponents(List<Component> components)`
    `void` | `setConfiguration(Configuration configuration)`
    `void` | `setDependencies(List<String> dependencies)`
    `void` | `setDescription(String description)`
    `void` | `setDockerClientConfig(String dockerClientConfig)`
    `void` | `setId(String id)`
    `void` | `setKerberosPrincipal(KerberosPrincipal kerberosPrincipal)`
    `void` | `setLaunchTime(Date launchTime)`
    `void` | `setLifetime(Long lifetime)`
    `void` | `setName(String name)`
    `void` | `setNumberOfRunningContainers(Long numberOfRunningContainers)`
    `void` | `setQueue(String queue)`
    `void` | `setQuicklinks(Map<String,String> quicklinks)`
    `void` | `setResource(Resource resource)`
    `void` | `setState(ServiceState state)`
    `void` | `setVersion(String version)`
    `Service` | `state(ServiceState state)` State of the service.
    `String` | `toString()`
    `Service` | `version(String version)` Version of the service.

    - ### Methods inherited from class org.apache.hadoop.yarn.service.api.records.BaseResource

      `getUri, setUri`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Service

          public Service()

  - ### Method Detail

    - #### 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`

Copyright © 2022 Apache Software Foundation. All rights reserved.