Search in sources :

Example 1 with ReleaseSharedCacheResourceResponse

use of org.apache.hadoop.yarn.api.protocolrecords.ReleaseSharedCacheResourceResponse in project hadoop by apache.

the class ClientProtocolService method release.

@Override
public ReleaseSharedCacheResourceResponse release(ReleaseSharedCacheResourceRequest request) throws YarnException, IOException {
    ReleaseSharedCacheResourceResponse response = recordFactory.newRecordInstance(ReleaseSharedCacheResourceResponse.class);
    UserGroupInformation callerUGI;
    try {
        callerUGI = UserGroupInformation.getCurrentUser();
    } catch (IOException ie) {
        LOG.info("Error getting UGI ", ie);
        throw RPCUtil.getRemoteException(ie);
    }
    boolean removed = this.store.removeResourceReference(request.getResourceKey(), new SharedCacheResourceReference(request.getAppId(), callerUGI.getShortUserName()), true);
    if (removed) {
        this.metrics.incCacheRelease();
    }
    return response;
}
Also used : ReleaseSharedCacheResourceResponse(org.apache.hadoop.yarn.api.protocolrecords.ReleaseSharedCacheResourceResponse) SharedCacheResourceReference(org.apache.hadoop.yarn.server.sharedcachemanager.store.SharedCacheResourceReference) IOException(java.io.IOException) UserGroupInformation(org.apache.hadoop.security.UserGroupInformation)

Aggregations

IOException (java.io.IOException)1 UserGroupInformation (org.apache.hadoop.security.UserGroupInformation)1 ReleaseSharedCacheResourceResponse (org.apache.hadoop.yarn.api.protocolrecords.ReleaseSharedCacheResourceResponse)1 SharedCacheResourceReference (org.apache.hadoop.yarn.server.sharedcachemanager.store.SharedCacheResourceReference)1