hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/web/client/OzoneBucket.java
public List<OzoneKey> listKeys(String resultLength, String previousKey,
      String prefix) throws OzoneException {
    HttpGet getRequest = null;
    try (CloseableHttpClient httpClient = HddsClientUtils.newHttpClient()) {
      OzoneRestClient client = getVolume().getClient();
      URIBuilder builder = new URIBuilder(volume.getClient().getEndPointURI());
      builder.setPath("/" + getVolume().getVolumeName() + "/" + getBucketName())
          .build();

      if (!Strings.isNullOrEmpty(resultLength)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_MAXKEYS, resultLength);
      }

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

      if (!Strings.isNullOrEmpty(prefix)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREFIX, prefix);
      }

      final String uri = builder.toString();
      getRequest = client.getHttpGet(uri);
      LOG.trace("listKeys URI={}", uri);
      return executeListKeys(getRequest, httpClient);

    } catch (IOException | URISyntaxException e) {
      throw new OzoneRestClientException(e.getMessage(), e);
    } finally {
      releaseConnection(getRequest);
    }
  }
/**
   * List all keys in a bucket.
   *
   * @param resultLength The max length of listing result.
   * @param previousKey The key from where listing should start,
   *                    this key is excluded in the result.
   * @param prefix The prefix that return list keys start with.
   * @return List of OzoneKeys
   * @throws OzoneException
   */
List all keys in a bucket.
@param resultLength The max length of listing result.
@param previousKey The key from where listing should start,
this key is excluded in the result.
@param prefix The prefix that return list keys start with.
List all keys in a bucket . @param resultLength The max length of listing result . @param previousKey The key from where listing should start this key is excluded in the result . @param prefix The prefix that return list keys start with .
public List<OzoneKey> listKeys(String resultLength, String previousKey,
      String prefix) throws OzoneException {
    HttpGet getRequest = null;
    try (CloseableHttpClient httpClient = HddsClientUtils.newHttpClient()) {
      OzoneRestClient client = getVolume().getClient();
      URIBuilder builder = new URIBuilder(volume.getClient().getEndPointURI());
      builder.setPath("/" + getVolume().getVolumeName() + "/" + getBucketName())
          .build();
      if (!Strings.isNullOrEmpty(resultLength)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_MAXKEYS, resultLength);
      }
      if (!Strings.isNullOrEmpty(previousKey)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREVKEY, previousKey);
      }
      if (!Strings.isNullOrEmpty(prefix)) {
        builder.addParameter(Header.OZONE_LIST_QUERY_PREFIX, prefix);
      }
      final String uri = builder.toString();
      getRequest = client.getHttpGet(uri);
      LOG.trace("listKeys URI={}", uri);
      return executeListKeys(getRequest, httpClient);
    } catch (IOException | URISyntaxException e) {
      throw new OzoneRestClientException(e.getMessage(), e);
    } finally {
      releaseConnection(getRequest);
    }
  }
public List < OzoneKey > listKeys ( String resultLength , String previousKey , String prefix ) throws OzoneException { HttpGet getRequest = null ; try ( CloseableHttpClient httpClient = HddsClientUtils . newHttpClient ( ) ) { OzoneRestClient client = getVolume ( ) . getClient ( ) ; URIBuilder builder = new URIBuilder ( volume . getClient ( ) . getEndPointURI ( ) ) ; builder . setPath ( "/" + getVolume ( ) . getVolumeName ( ) + "/" + getBucketName ( ) ) . build ( ) ; if ( ! Strings . isNullOrEmpty ( resultLength ) ) { builder . addParameter ( Header . OZONE_LIST_QUERY_MAXKEYS , resultLength ) ; } if ( ! Strings . isNullOrEmpty ( previousKey ) ) { builder . addParameter ( Header . OZONE_LIST_QUERY_PREVKEY , previousKey ) ; } if ( ! Strings . isNullOrEmpty ( prefix ) ) { builder . addParameter ( Header . OZONE_LIST_QUERY_PREFIX , prefix ) ; } final String uri = builder . toString ( ) ; getRequest = client . getHttpGet ( uri ) ; LOG . trace ( "listKeys URI={}" , uri ) ; return executeListKeys ( getRequest , httpClient ) ; } catch ( IOException | URISyntaxException e ) { throw new OzoneRestClientException ( e . getMessage ( ) , e ) ; } finally { releaseConnection ( getRequest ) ; } }
List all keys in a bucket.
List all keys in a bucket .