org.apache.hadoop.yarn.api.records

## Class ResourceRequest.ResourceRequestBuilder

- java.lang.Object
- - org.apache.hadoop.yarn.api.records.ResourceRequest.ResourceRequestBuilder

- Enclosing class:
    ResourceRequest

      @InterfaceAudience.Public
       @InterfaceStability.Stable
      public static final class ResourceRequest.ResourceRequestBuilder
      extends Object

  Class to construct instances of `ResourceRequest` with specific options.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ResourceRequest.ResourceRequestBuilder` | `allocationRequestId(long allocationRequestId)` Set the `allocationRequestId` of the request.
    `ResourceRequest` | `build()` Return generated `ResourceRequest` object.
    `ResourceRequest.ResourceRequestBuilder` | `capability(Resource capability)` Set the `capability` of the request.
    `ResourceRequest.ResourceRequestBuilder` | `executionType(ExecutionType executionType)` Set the `executionTypeRequest` of the request with 'ensure execution type' flag set to true.
    `ResourceRequest.ResourceRequestBuilder` | `executionTypeRequest(ExecutionTypeRequest executionTypeRequest)` Set the `executionTypeRequest` of the request.
    `ResourceRequest.ResourceRequestBuilder` | `nodeLabelExpression(String nodeLabelExpression)` Set the `nodeLabelExpression` of the request.
    `ResourceRequest.ResourceRequestBuilder` | `numContainers(int numContainers)` Set the `numContainers` of the request.
    `ResourceRequest.ResourceRequestBuilder` | `priority(Priority priority)` Set the `priority` of the request.
    `ResourceRequest.ResourceRequestBuilder` | `relaxLocality(boolean relaxLocality)` Set the `relaxLocality` of the request.
    `ResourceRequest.ResourceRequestBuilder` | `resourceName(String resourceName)` Set the `resourceName` of the request.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### priority

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public ResourceRequest.ResourceRequestBuilder priority(Priority priority)

      Set the `priority` of the request.
      Parameters:
        `priority` - `priority` of the request
      Returns:
        `ResourceRequest.ResourceRequestBuilder`
      See Also:
        `ResourceRequest.setPriority(Priority)`

    - #### resourceName

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public ResourceRequest.ResourceRequestBuilder resourceName(String resourceName)

      Set the `resourceName` of the request.
      Parameters:
        `resourceName` - `resourceName` of the request
      Returns:
        `ResourceRequest.ResourceRequestBuilder`
      See Also:
        `ResourceRequest.setResourceName(String)`

    - #### capability

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public ResourceRequest.ResourceRequestBuilder capability(Resource capability)

      Set the `capability` of the request.
      Parameters:
        `capability` - `capability` of the request
      Returns:
        `ResourceRequest.ResourceRequestBuilder`
      See Also:
        `ResourceRequest.setCapability(Resource)`

    - #### numContainers

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public ResourceRequest.ResourceRequestBuilder numContainers(int numContainers)

      Set the `numContainers` of the request.
      Parameters:
        `numContainers` - `numContainers` of the request
      Returns:
        `ResourceRequest.ResourceRequestBuilder`
      See Also:
        `ResourceRequest.setNumContainers(int)`

    - #### relaxLocality

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public ResourceRequest.ResourceRequestBuilder relaxLocality(boolean relaxLocality)

      Set the `relaxLocality` of the request.
      Parameters:
        `relaxLocality` - `relaxLocality` of the request
      Returns:
        `ResourceRequest.ResourceRequestBuilder`
      See Also:
        `ResourceRequest.setRelaxLocality(boolean)`

    - #### nodeLabelExpression

          @InterfaceAudience.Public
           @InterfaceStability.Evolving
          public ResourceRequest.ResourceRequestBuilder nodeLabelExpression(String nodeLabelExpression)

      Set the `nodeLabelExpression` of the request.
      Parameters:
        `nodeLabelExpression` - `nodeLabelExpression` of the request
      Returns:
        `ResourceRequest.ResourceRequestBuilder`
      See Also:
        `ResourceRequest.setNodeLabelExpression(String)`

    - #### executionTypeRequest

          @InterfaceAudience.Public
           @InterfaceStability.Evolving
          public ResourceRequest.ResourceRequestBuilder executionTypeRequest(ExecutionTypeRequest executionTypeRequest)

      Set the `executionTypeRequest` of the request.
      Parameters:
        `executionTypeRequest` - `executionTypeRequest` of the request
      Returns:
        `ResourceRequest.ResourceRequestBuilder`
      See Also:
        `ResourceRequest.setExecutionTypeRequest( ExecutionTypeRequest)`

    - #### executionType

          @InterfaceAudience.Public
           @InterfaceStability.Evolving
          public ResourceRequest.ResourceRequestBuilder executionType(ExecutionType executionType)

      Set the `executionTypeRequest` of the request with 'ensure execution type' flag set to true.
      Parameters:
        `executionType` - `executionType` of the request.
      Returns:
        `ResourceRequest.ResourceRequestBuilder`
      See Also:
        `ResourceRequest.setExecutionTypeRequest( ExecutionTypeRequest)`

    - #### allocationRequestId

          @InterfaceAudience.Public
           @InterfaceStability.Evolving
          public ResourceRequest.ResourceRequestBuilder allocationRequestId(long allocationRequestId)

      Set the `allocationRequestId` of the request.
      Parameters:
        `allocationRequestId` - `allocationRequestId` of the request
      Returns:
        `ResourceRequest.ResourceRequestBuilder`
      See Also:
        `ResourceRequest.setAllocationRequestId(long)`

    - #### build

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public ResourceRequest build()

      Return generated `ResourceRequest` object.
      Returns:
        `ResourceRequest`

Copyright © 2022 Apache Software Foundation. All rights reserved.