@Override
  public void release(ApplicationId applicationId, String resourceKey)
      throws YarnException {
    ReleaseSharedCacheResourceRequest request = Records.newRecord(
        ReleaseSharedCacheResourceRequest.class);
    request.setAppId(applicationId);
    request.setResourceKey(resourceKey);
    try {
      // We do not care about the response because it is empty.
      this.scmClient.release(request);
    } catch (Exception e) {
      // Just catching IOException isn't enough.
      // RPC call can throw ConnectionException.
      throw new YarnException(e);
    }
  }
@Test
  public void testRelease() throws Exception {
    // Release does not care about the return value because it is empty
    when(cProtocol.release(isA(ReleaseSharedCacheResourceRequest.class)))
        .thenReturn(null);
    client.release(mock(ApplicationId.class), "key");
  }