hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/web/client/OzoneRestClient.java
public List<OzoneVolume> listVolumes(String onBehalfOf, String prefix,
      int maxKeys, String previousVolume) throws OzoneException {
    HttpGet httpGet = null;
    try (CloseableHttpClient httpClient = newHttpClient()) {
      URIBuilder builder = new URIBuilder(endPointURI);
      if (!Strings.isNullOrEmpty(prefix)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREFIX, prefix);
      }

      if (maxKeys > 0) {
        builder.addParameter(Header.OZONE_LIST_QUERY_MAXKEYS, Integer
            .toString(maxKeys));
      }

      if (!Strings.isNullOrEmpty(previousVolume)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREVKEY,
            previousVolume);
      }

      builder.setPath("/").build();

      httpGet = getHttpGet(builder.toString());
      if (onBehalfOf != null) {
        httpGet.addHeader(Header.OZONE_USER, onBehalfOf);
      }
      return executeListVolume(httpGet, httpClient);
    } catch (IOException | URISyntaxException ex) {
      throw new OzoneRestClientException(ex.getMessage(), ex);
    } finally {
      releaseConnection(httpGet);
    }
  }
/**
   * List all the volumes owned by the user or Owned by the user specified in
   * the behalf of string.
   *
   * @param onBehalfOf
   *  User Name of the user if it is not the caller. for example,
   *  an admin wants to list some other users volumes.
   * @param prefix
   *   Return only volumes that match this prefix.
   * @param maxKeys
   *   Maximum number of results to return, if the result set
   *   is smaller than requested size, it means that list is
   *   complete.
   * @param previousVolume
   *   The previous volume name.
   * @return List of Volumes
   * @throws OzoneException
   */
List all the volumes owned by the user or Owned by the user specified in
the behalf of string.

@param onBehalfOf
User Name of the user if it is not the caller. for example,
an admin wants to list some other users volumes.
@param prefix
Return only volumes that match this prefix.
@param maxKeys
Maximum number of results to return, if the result set
is smaller than requested size, it means that list is
complete.
@param previousVolume
The previous volume name.
@return List of Volumes
@throws OzoneException
List all the volumes owned by the user or Owned by the user specified in the behalf of string . @param onBehalfOf User Name of the user if it is not the caller . for example an admin wants to list some other users volumes . @param prefix Return only volumes that match this prefix . @param maxKeys Maximum number of results to return if the result set is smaller than requested size it means that list is complete . @param previousVolume The previous volume name . @return List of Volumes @throws OzoneException
public List<OzoneVolume> listVolumes(String onBehalfOf, String prefix,
      int maxKeys, String previousVolume) throws OzoneException {
    HttpGet httpGet = null;
    try (CloseableHttpClient httpClient = newHttpClient()) {
      URIBuilder builder = new URIBuilder(endPointURI);
      if (!Strings.isNullOrEmpty(prefix)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREFIX, prefix);
      }
      if (maxKeys > 0) {
        builder.addParameter(Header.OZONE_LIST_QUERY_MAXKEYS, Integer
            .toString(maxKeys));
      }
      if (!Strings.isNullOrEmpty(previousVolume)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREVKEY,
            previousVolume);
      }
      builder.setPath("/").build();
      httpGet = getHttpGet(builder.toString());
      if (onBehalfOf != null) {
        httpGet.addHeader(Header.OZONE_USER, onBehalfOf);
      }
      return executeListVolume(httpGet, httpClient);
    } catch (IOException | URISyntaxException ex) {
      throw new OzoneRestClientException(ex.getMessage(), ex);
    } finally {
      releaseConnection(httpGet);
    }
  }
public List < OzoneVolume > listVolumes ( String onBehalfOf , String prefix , int maxKeys , String previousVolume ) throws OzoneException { HttpGet httpGet = null ; try ( CloseableHttpClient httpClient = newHttpClient ( ) ) { URIBuilder builder = new URIBuilder ( endPointURI ) ; if ( ! Strings . isNullOrEmpty ( prefix ) ) { builder . addParameter ( Header . OZONE_LIST_QUERY_PREFIX , prefix ) ; } if ( maxKeys > 0 ) { builder . addParameter ( Header . OZONE_LIST_QUERY_MAXKEYS , Integer . toString ( maxKeys ) ) ; } if ( ! Strings . isNullOrEmpty ( previousVolume ) ) { builder . addParameter ( Header . OZONE_LIST_QUERY_PREVKEY , previousVolume ) ; } builder . setPath ( "/" ) . build ( ) ; httpGet = getHttpGet ( builder . toString ( ) ) ; if ( onBehalfOf != null ) { httpGet . addHeader ( Header . OZONE_USER , onBehalfOf ) ; } return executeListVolume ( httpGet , httpClient ) ; } catch ( IOException | URISyntaxException ex ) { throw new OzoneRestClientException ( ex . getMessage ( ) , ex ) ; } finally { releaseConnection ( httpGet ) ; } }
List all the volumes owned by the user or Owned by the user specified in
 the behalf of string.
List all the volumes owned by the user or Owned by the user specified in the behalf of string .