ClientSCMProtocol (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.yarn.api, interface: ClientSCMProtocol

Package org.apache.hadoop.yarn.api

# Interface ClientSCMProtocol

@Public @Unstable public interface ClientSCMProtocol

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

- ## Method Summary

  Modifier and Type
  Method
  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 Details

  - ### 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` - exceptions from yarn servers.
      `IOException` - io error occur.

  - ### 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` - exceptions from yarn servers.
      `IOException` - io error occur.