hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/web/client/OzoneRestClient.java
private OzoneVolume executeInfoVolume(HttpGet httpGet,
      final CloseableHttpClient httpClient)
      throws IOException, OzoneException {
    HttpEntity entity = null;
    try {
      HttpResponse response = httpClient.execute(httpGet);
      int errorCode = response.getStatusLine().getStatusCode();

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

      if (errorCode == HTTP_OK) {
        OzoneVolume volume = new OzoneVolume(this);
        volume.setVolumeInfo(EntityUtils.toString(entity));
        return volume;
      } else {
        throw OzoneException.parse(EntityUtils.toString(entity));
      }
    } finally {
      if (entity != null) {
        EntityUtils.consumeQuietly(entity);
      }
    }
  }
/**
   * Sends the create Volume request to the server.
   *
   * @param httpGet - httpGet
   * @return OzoneVolume
   * @throws IOException    -
   * @throws OzoneException
   */
Sends the create Volume request to the server.
@param httpGet - httpGet
@return OzoneVolume
@throws IOException
@throws OzoneException
Sends the create Volume request to the server . @param httpGet - httpGet @return OzoneVolume @throws IOException @throws OzoneException
private OzoneVolume executeInfoVolume(HttpGet httpGet,
      final CloseableHttpClient httpClient)
      throws IOException, OzoneException {
    HttpEntity entity = null;
    try {
      HttpResponse response = httpClient.execute(httpGet);
      int errorCode = response.getStatusLine().getStatusCode();
      entity = response.getEntity();
      if (entity == null) {
        throw new OzoneRestClientException("Unexpected null in http payload");
      }
      if (errorCode == HTTP_OK) {
        OzoneVolume volume = new OzoneVolume(this);
        volume.setVolumeInfo(EntityUtils.toString(entity));
        return volume;
      } else {
        throw OzoneException.parse(EntityUtils.toString(entity));
      }
    } finally {
      if (entity != null) {
        EntityUtils.consumeQuietly(entity);
      }
    }
  }
private OzoneVolume executeInfoVolume ( HttpGet httpGet , final CloseableHttpClient httpClient ) throws IOException , OzoneException { HttpEntity entity = null ; try { HttpResponse response = httpClient . execute ( httpGet ) ; int errorCode = response . getStatusLine ( ) . getStatusCode ( ) ; entity = response . getEntity ( ) ; if ( entity == null ) { throw new OzoneRestClientException ( "Unexpected null in http payload" ) ; } if ( errorCode == HTTP_OK ) { OzoneVolume volume = new OzoneVolume ( this ) ; volume . setVolumeInfo ( EntityUtils . toString ( entity ) ) ; return volume ; } else { throw OzoneException . parse ( EntityUtils . toString ( entity ) ) ; } } finally { if ( entity != null ) { EntityUtils . consumeQuietly ( entity ) ; } } }
Sends the create Volume request to the server.
Sends the create Volume request to the server .