hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/web/client/OzoneBucket.java
public void deleteKey(String keyName) throws OzoneException {

    if ((keyName == null) || keyName.isEmpty()) {
      throw new OzoneRestClientException("Invalid key Name");
    }

    HttpDelete deleteRequest = null;
    try (CloseableHttpClient httpClient = HddsClientUtils.newHttpClient()) {
      URIBuilder builder = new URIBuilder(volume.getClient().getEndPointURI());
      builder.setPath("/" + getVolume().getVolumeName() + "/" + getBucketName()
          + "/" + keyName).build();

      deleteRequest = getVolume()
          .getClient().getHttpDelete(builder.toString());
      executeDeleteKey(deleteRequest, httpClient);
    } catch (IOException | URISyntaxException ex) {
      throw new OzoneRestClientException(ex.getMessage(), ex);
    } finally {
      releaseConnection(deleteRequest);
    }
  }
/**
   * Deletes a key in this bucket.
   *
   * @param keyName - Name of the Key
   * @throws OzoneException
   */
Deletes a key in this bucket.
@param keyName - Name of the Key
@throws OzoneException
Deletes a key in this bucket . @param keyName - Name of the Key @throws OzoneException
public void deleteKey(String keyName) throws OzoneException {
    if ((keyName == null) || keyName.isEmpty()) {
      throw new OzoneRestClientException("Invalid key Name");
    }
    HttpDelete deleteRequest = null;
    try (CloseableHttpClient httpClient = HddsClientUtils.newHttpClient()) {
      URIBuilder builder = new URIBuilder(volume.getClient().getEndPointURI());
      builder.setPath("/" + getVolume().getVolumeName() + "/" + getBucketName()
          + "/" + keyName).build();
      deleteRequest = getVolume()
          .getClient().getHttpDelete(builder.toString());
      executeDeleteKey(deleteRequest, httpClient);
    } catch (IOException | URISyntaxException ex) {
      throw new OzoneRestClientException(ex.getMessage(), ex);
    } finally {
      releaseConnection(deleteRequest);
    }
  }
public void deleteKey ( String keyName ) throws OzoneException { if ( ( keyName == null ) || keyName . isEmpty ( ) ) { throw new OzoneRestClientException ( "Invalid key Name" ) ; } HttpDelete deleteRequest = null ; try ( CloseableHttpClient httpClient = HddsClientUtils . newHttpClient ( ) ) { URIBuilder builder = new URIBuilder ( volume . getClient ( ) . getEndPointURI ( ) ) ; builder . setPath ( "/" + getVolume ( ) . getVolumeName ( ) + "/" + getBucketName ( ) + "/" + keyName ) . build ( ) ; deleteRequest = getVolume ( ) . getClient ( ) . getHttpDelete ( builder . toString ( ) ) ; executeDeleteKey ( deleteRequest , httpClient ) ; } catch ( IOException | URISyntaxException ex ) { throw new OzoneRestClientException ( ex . getMessage ( ) , ex ) ; } finally { releaseConnection ( deleteRequest ) ; } }
Deletes a key in this bucket.
Deletes a key in this bucket .