@Override public ReleaseSharedCacheResourceResponse release( ReleaseSharedCacheResourceRequest request) throws YarnException, IOException { ReleaseSharedCacheResourceRequestProto requestProto = ((ReleaseSharedCacheResourceRequestPBImpl) request).getProto(); try { return new ReleaseSharedCacheResourceResponsePBImpl(proxy.release(null, requestProto)); } catch (ServiceException e) { RPCUtil.unwrapAndThrowException(e); return null; } }
@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; }
/** * <p> * The interface used by clients to release a resource with the * <code>SharedCacheManager.</code> 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 {@link ApplicationId} to * identify which application is releasing the resource. * </p> * * <p> * Note: This method is an optimization and the client is not required to call * it for correctness. * </p> * * <p> * Currently the <code>SharedCacheManager</code> sends an empty response. * </p> * * @param request request to release a resource in the shared cache * @return (empty) response on releasing the resource * @throws YarnException * @throws IOException */ public ReleaseSharedCacheResourceResponse release( ReleaseSharedCacheResourceRequest request) throws YarnException, IOException;