org.apache.hadoop.yarn.api

## Interface ClientSCMProtocol

-     @InterfaceAudience.Public
       @InterfaceStability.Unstable
      public interface ClientSCMProtocol

  The protocol between clients and the `SharedCacheManager` to claim and release resources in the shared cache.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ReleaseSharedCacheResourceResponse` | `release(ReleaseSharedCacheResourceRequest request)` The interface used by clients to release a resource with the `SharedCacheManager.` This method is called once an application is no longer using a claimed resource in the shared cache.
    `UseSharedCacheResourceResponse` | `use(UseSharedCacheResourceRequest request)` The interface used by clients to claim a resource with the `SharedCacheManager.` The client uses a checksum to identify the resource and an `ApplicationId` to identify which application will be using the resource.

- - ### Method Detail

    - #### use

          UseSharedCacheResourceResponse use(UseSharedCacheResourceRequest request)
                                      throws YarnException,
                                             IOException

      The interface used by clients to claim a resource with the `SharedCacheManager.` The client uses a checksum to identify the resource and an `ApplicationId` to identify which application will be using the resource.

      The `SharedCacheManager` responds with whether or not the resource exists in the cache. If the resource exists, a `Path` to the resource in the shared cache is returned. If the resource does not exist, the response is empty.

      Parameters:
        `request` - request to claim a resource in the shared cache
      Returns:
        response indicating if the resource is already in the cache
      Throws:
        `YarnException`
        `IOException`

    - #### release

          ReleaseSharedCacheResourceResponse release(ReleaseSharedCacheResourceRequest request)
                                              throws YarnException,
                                                     IOException

      The interface used by clients to release a resource with the `SharedCacheManager.` This method is called once an application is no longer using a claimed resource in the shared cache. The client uses a checksum to identify the resource and an `ApplicationId` to identify which application is releasing the resource.

      Note: This method is an optimization and the client is not required to call it for correctness.

      Currently the `SharedCacheManager` sends an empty response.

      Parameters:
        `request` - request to release a resource in the shared cache
      Returns:
        (empty) response on releasing the resource
      Throws:
        `YarnException`
        `IOException`

Copyright © 2022 Apache Software Foundation. All rights reserved.