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

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

      if (prevKey != null) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREVKEY,
            prevKey.getOwnerName()+ "/" + prevKey.getVolumeName());
      }

      builder.addParameter(Header.OZONE_LIST_QUERY_ROOTSCAN, "true");
      builder.setPath("/").build();
      httpGet = getHttpGet(builder.toString());
      return executeListVolume(httpGet, httpClient);

    } catch (IOException | URISyntaxException ex) {
      throw new OzoneRestClientException(ex.getMessage(), ex);
    } finally {
      releaseConnection(httpGet);
    }
  }
/**
   * List all volumes in a cluster. This can be invoked only by an Admin.
   *
   * @param prefix  - Returns only volumes that match this prefix.
   * @param maxKeys - Maximum niumber of keys to return
   * @param prevKey - Last Ozone Volume from the last Iteration.
   * @return List of Volumes
   * @throws OzoneException
   */
List all volumes in a cluster. This can be invoked only by an Admin.
@param prefix  - Returns only volumes that match this prefix.
@param maxKeys - Maximum niumber of keys to return
@param prevKey - Last Ozone Volume from the last Iteration.
@return List of Volumes
@throws OzoneException
List all volumes in a cluster . This can be invoked only by an Admin . @param prefix - Returns only volumes that match this prefix . @param maxKeys - Maximum niumber of keys to return @param prevKey - Last Ozone Volume from the last Iteration . @return List of Volumes @throws OzoneException
public List<OzoneVolume> listAllVolumes(String prefix, int maxKeys,
      OzoneVolume prevKey) throws OzoneException {
    HttpGet httpGet = null;
    try (CloseableHttpClient httpClient = newHttpClient()) {
      URIBuilder builder = new URIBuilder(endPointURI);
      if (prefix != null) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREFIX, prefix);
      }
      if (maxKeys > 0) {
        builder.addParameter(Header.OZONE_LIST_QUERY_MAXKEYS, Integer
            .toString(maxKeys));
      }
      if (prevKey != null) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREVKEY,
            prevKey.getOwnerName()+ "/" + prevKey.getVolumeName());
      }
      builder.addParameter(Header.OZONE_LIST_QUERY_ROOTSCAN, "true");
      builder.setPath("/").build();
      httpGet = getHttpGet(builder.toString());
      return executeListVolume(httpGet, httpClient);
    } catch (IOException | URISyntaxException ex) {
      throw new OzoneRestClientException(ex.getMessage(), ex);
    } finally {
      releaseConnection(httpGet);
    }
  }
public List < OzoneVolume > listAllVolumes ( String prefix , int maxKeys , OzoneVolume prevKey ) throws OzoneException { HttpGet httpGet = null ; try ( CloseableHttpClient httpClient = newHttpClient ( ) ) { URIBuilder builder = new URIBuilder ( endPointURI ) ; if ( prefix != null ) { builder . addParameter ( Header . OZONE_LIST_QUERY_PREFIX , prefix ) ; } if ( maxKeys > 0 ) { builder . addParameter ( Header . OZONE_LIST_QUERY_MAXKEYS , Integer . toString ( maxKeys ) ) ; } if ( prevKey != null ) { builder . addParameter ( Header . OZONE_LIST_QUERY_PREVKEY , prevKey . getOwnerName ( ) + "/" + prevKey . getVolumeName ( ) ) ; } builder . addParameter ( Header . OZONE_LIST_QUERY_ROOTSCAN , "true" ) ; builder . setPath ( "/" ) . build ( ) ; httpGet = getHttpGet ( builder . toString ( ) ) ; return executeListVolume ( httpGet , httpClient ) ; } catch ( IOException | URISyntaxException ex ) { throw new OzoneRestClientException ( ex . getMessage ( ) , ex ) ; } finally { releaseConnection ( httpGet ) ; } }
List all volumes in a cluster.
List all volumes in a cluster .