@InterfaceAudience.Private @InterfaceStability.Unstable public class SharedCacheClientImpl extends SharedCacheClient
| Constructor and Description |
|---|
SharedCacheClientImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.hadoop.yarn.api.ClientSCMProtocol |
createClientProxy() |
String |
getFileChecksum(org.apache.hadoop.fs.Path sourceFile)
A convenience method to calculate the checksum of a specified file.
|
void |
release(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
String resourceKey)
The method 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. |
protected void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
protected void |
serviceStart() |
protected void |
serviceStop() |
protected void |
stopClientProxy() |
org.apache.hadoop.yarn.api.records.URL |
use(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
String resourceKey)
The method 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. |
createSharedCacheClientclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopprotected void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws Exception
serviceInit in class org.apache.hadoop.service.AbstractServiceExceptionprotected void serviceStart()
throws Exception
serviceStart in class org.apache.hadoop.service.AbstractServiceExceptionprotected void serviceStop()
throws Exception
serviceStop in class org.apache.hadoop.service.AbstractServiceExceptionprotected org.apache.hadoop.yarn.api.ClientSCMProtocol createClientProxy()
protected void stopClientProxy()
public org.apache.hadoop.yarn.api.records.URL use(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
String resourceKey)
throws org.apache.hadoop.yarn.exceptions.YarnException
SharedCacheClient
The method 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 URL to
the resource in the shared cache is returned. If the resource does not
exist, null is returned instead.
Once a URL has been returned for a resource, that URL is safe to use for the lifetime of the application that corresponds to the provided ApplicationId.
use in class SharedCacheClientapplicationId - ApplicationId of the application using the resourceresourceKey - the key (i.e. checksum) that identifies the resourceorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic void release(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
String resourceKey)
throws org.apache.hadoop.yarn.exceptions.YarnException
SharedCacheClient
The method 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.
release in class SharedCacheClientapplicationId - ApplicationId of the application releasing the
resourceresourceKey - the key (i.e. checksum) that identifies the resourceorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic String getFileChecksum(org.apache.hadoop.fs.Path sourceFile) throws IOException
SharedCacheClientgetFileChecksum in class SharedCacheClientsourceFile - A path to the input fileIOExceptionCopyright © 2022 Apache Software Foundation. All rights reserved.