hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/web/client/OzoneVolume.java
private void executeCreateBucket(HttpPost httppost,
      CloseableHttpClient httpClient)
      throws IOException, OzoneException {
    HttpEntity entity = null;
    try {
      HttpResponse response = httpClient.execute(httppost);
      int errorCode = response.getStatusLine().getStatusCode();
      entity = response.getEntity();
      if ((errorCode == HTTP_OK) || (errorCode == HTTP_CREATED)) {
        return;
      }

      if (entity != null) {
        throw OzoneException.parse(EntityUtils.toString(entity));
      } else {
        throw new OzoneRestClientException("Unexpected null in http payload");
      }
    } finally {
      if (entity != null) {
        EntityUtils.consumeQuietly(entity);
      }
    }
  }
/**
   * execute a Create Bucket Request against Ozone server.
   *
   * @param httppost - httpPost
   *
   * @throws IOException
   * @throws OzoneException
   */
execute a Create Bucket Request against Ozone server.
@param httppost - httpPost


execute a Create Bucket Request against Ozone server . @param httppost - httpPost
private void executeCreateBucket(HttpPost httppost,
      CloseableHttpClient httpClient)
      throws IOException, OzoneException {
    HttpEntity entity = null;
    try {
      HttpResponse response = httpClient.execute(httppost);
      int errorCode = response.getStatusLine().getStatusCode();
      entity = response.getEntity();
      if ((errorCode == HTTP_OK) || (errorCode == HTTP_CREATED)) {
        return;
      }
      if (entity != null) {
        throw OzoneException.parse(EntityUtils.toString(entity));
      } else {
        throw new OzoneRestClientException("Unexpected null in http payload");
      }
    } finally {
      if (entity != null) {
        EntityUtils.consumeQuietly(entity);
      }
    }
  }
private void executeCreateBucket ( HttpPost httppost , CloseableHttpClient httpClient ) throws IOException , OzoneException { HttpEntity entity = null ; try { HttpResponse response = httpClient . execute ( httppost ) ; int errorCode = response . getStatusLine ( ) . getStatusCode ( ) ; entity = response . getEntity ( ) ; if ( ( errorCode == HTTP_OK ) || ( errorCode == HTTP_CREATED ) ) { return ; } if ( entity != null ) { throw OzoneException . parse ( EntityUtils . toString ( entity ) ) ; } else { throw new OzoneRestClientException ( "Unexpected null in http payload" ) ; } } finally { if ( entity != null ) { EntityUtils . consumeQuietly ( entity ) ; } } }
execute a Create Bucket Request against Ozone server.
execute a Create Bucket Request against Ozone server .