hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/web/client/OzoneBucket.java
public static void executePutKey(HttpPut putRequest,
      CloseableHttpClient httpClient) throws OzoneException, IOException {
    HttpEntity entity = null;
    try {
      HttpResponse response = httpClient.execute(putRequest);
      int errorCode = response.getStatusLine().getStatusCode();
      entity = response.getEntity();

      if ((errorCode == HTTP_OK) || (errorCode == HTTP_CREATED)) {
        return;
      }

      if (entity == null) {
        throw new OzoneRestClientException("Unexpected null in http payload");
      }

      throw OzoneException.parse(EntityUtils.toString(entity));
    } finally {
      if (entity != null) {
        EntityUtils.consumeQuietly(entity);
      }
    }
  }
/**
   * executePutKey executes the Put request against the Ozone Server.
   *
   * @param putRequest - Http Put Request
   * @param httpClient - httpClient
   * @throws OzoneException
   * @throws IOException
   */
executePutKey executes the Put request against the Ozone Server.
@param putRequest - Http Put Request
@param httpClient - httpClient
@throws OzoneException
@throws IOException
executePutKey executes the Put request against the Ozone Server . @param putRequest - Http Put Request @param httpClient - httpClient @throws OzoneException @throws IOException
public static void executePutKey(HttpPut putRequest,
      CloseableHttpClient httpClient) throws OzoneException, IOException {
    HttpEntity entity = null;
    try {
      HttpResponse response = httpClient.execute(putRequest);
      int errorCode = response.getStatusLine().getStatusCode();
      entity = response.getEntity();
      if ((errorCode == HTTP_OK) || (errorCode == HTTP_CREATED)) {
        return;
      }
      if (entity == null) {
        throw new OzoneRestClientException("Unexpected null in http payload");
      }
      throw OzoneException.parse(EntityUtils.toString(entity));
    } finally {
      if (entity != null) {
        EntityUtils.consumeQuietly(entity);
      }
    }
  }
public static void executePutKey ( HttpPut putRequest , CloseableHttpClient httpClient ) throws OzoneException , IOException { HttpEntity entity = null ; try { HttpResponse response = httpClient . execute ( putRequest ) ; int errorCode = response . getStatusLine ( ) . getStatusCode ( ) ; entity = response . getEntity ( ) ; if ( ( errorCode == HTTP_OK ) || ( errorCode == HTTP_CREATED ) ) { return ; } if ( entity == null ) { throw new OzoneRestClientException ( "Unexpected null in http payload" ) ; } throw OzoneException . parse ( EntityUtils . toString ( entity ) ) ; } finally { if ( entity != null ) { EntityUtils . consumeQuietly ( entity ) ; } } }
executePutKey executes the Put request against the Ozone Server.
executePutKey executes the Put request against the Ozone Server .