hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/web/client/OzoneBucket.java
public List<OzoneKey> listKeys(String prefix, int maxResult, String prevKey)
      throws OzoneException {
    HttpGet getRequest = null;
    try {
      final URI uri =  new URIBuilder(volume.getClient().getEndPointURI())
          .setPath(OzoneConsts.KSM_KEY_PREFIX + getVolume().getVolumeName() +
              OzoneConsts.KSM_KEY_PREFIX + getBucketName())
          .setParameter(Header.OZONE_LIST_QUERY_PREFIX, prefix)
          .setParameter(Header.OZONE_LIST_QUERY_MAXKEYS,
              String.valueOf(maxResult))
          .setParameter(Header.OZONE_LIST_QUERY_PREVKEY, prevKey)
          .build();
      final OzoneRestClient client = getVolume().getClient();
      getRequest = client.getHttpGet(uri.toString());
      return executeListKeys(getRequest, HttpClientBuilder.create().build());
    } catch (IOException | URISyntaxException e) {
      throw new OzoneRestClientException(e.getMessage());
    } finally {
      releaseConnection(getRequest);
    }
  }
/**
   * List keys in a bucket with the provided prefix, with paging results.
   *
   * @param prefix The prefix of the object keys
   * @param maxResult max size per response
   * @param prevKey the previous key for paging
   */
List keys in a bucket with the provided prefix, with paging results.
@param prefix The prefix of the object keys
@param maxResult max size per response
@param prevKey the previous key for paging
List keys in a bucket with the provided prefix with paging results . @param prefix The prefix of the object keys @param maxResult max size per response @param prevKey the previous key for paging
public List<OzoneKey> listKeys(String prefix, int maxResult, String prevKey)
      throws OzoneException {
    HttpGet getRequest = null;
    try {
      final URI uri =  new URIBuilder(volume.getClient().getEndPointURI())
          .setPath(OzoneConsts.KSM_KEY_PREFIX + getVolume().getVolumeName() +
              OzoneConsts.KSM_KEY_PREFIX + getBucketName())
          .setParameter(Header.OZONE_LIST_QUERY_PREFIX, prefix)
          .setParameter(Header.OZONE_LIST_QUERY_MAXKEYS,
              String.valueOf(maxResult))
          .setParameter(Header.OZONE_LIST_QUERY_PREVKEY, prevKey)
          .build();
      final OzoneRestClient client = getVolume().getClient();
      getRequest = client.getHttpGet(uri.toString());
      return executeListKeys(getRequest, HttpClientBuilder.create().build());
    } catch (IOException | URISyntaxException e) {
      throw new OzoneRestClientException(e.getMessage());
    } finally {
      releaseConnection(getRequest);
    }
  }
public List < OzoneKey > listKeys ( String prefix , int maxResult , String prevKey ) throws OzoneException { HttpGet getRequest = null ; try { final URI uri = new URIBuilder ( volume . getClient ( ) . getEndPointURI ( ) ) . setPath ( OzoneConsts . KSM_KEY_PREFIX + getVolume ( ) . getVolumeName ( ) + OzoneConsts . KSM_KEY_PREFIX + getBucketName ( ) ) . setParameter ( Header . OZONE_LIST_QUERY_PREFIX , prefix ) . setParameter ( Header . OZONE_LIST_QUERY_MAXKEYS , String . valueOf ( maxResult ) ) . setParameter ( Header . OZONE_LIST_QUERY_PREVKEY , prevKey ) . build ( ) ; final OzoneRestClient client = getVolume ( ) . getClient ( ) ; getRequest = client . getHttpGet ( uri . toString ( ) ) ; return executeListKeys ( getRequest , HttpClientBuilder . create ( ) . build ( ) ) ; } catch ( IOException | URISyntaxException e ) { throw new OzoneRestClientException ( e . getMessage ( ) ) ; } finally { releaseConnection ( getRequest ) ; } }
List keys in a bucket with the provided prefix, with paging results.
List keys in a bucket with the provided prefix with paging results .