Example usage for org.apache.hadoop.hdfs.web.resources Param toSortedString

List of usage examples for org.apache.hadoop.hdfs.web.resources Param toSortedString

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.web.resources Param toSortedString.

Prototype

public static String toSortedString(final String separator, final Param<?, ?>... parameters) 

Source Link

Document

Convert the parameters to a sorted String.

Usage

From source file:com.bigstep.datalake.DLFileSystem.java

License:Apache License

/**
 * Compute the path associated to a specific operation
 * @param op the operation to be executed
 * @param fspath the path, can be relative
 * @param parameters various params depending on the operation
 * @return the full HTTP url/*from  www .j  a  v a  2  s  .c  o m*/
 * @throws IOException
 */
@VisibleForTesting
private URL toUrl(final HttpOpParam.Op op, final Path fspath, final Param<?, ?>... parameters)
        throws IOException {

    //initialize URI path and query
    final String path = PATH_PREFIX + (fspath == null ? "/" : makeQualified(fspath).toUri().getRawPath());
    final String query = op.toQueryString() + Param.toSortedString("&", getAuthParameters(op))
            + Param.toSortedString("&", parameters);

    //TODO: add loadbalancing
    final URL url = getNamenodeURL(path, query);
    if (LOG.isTraceEnabled()) {
        LOG.trace("url=" + url);
    }

    return url;
}