Example #1
0
        internal Uri CreateRequestUri(WebHdfsOperation operation, string path, List <KeyValuePair <string, string> > parameters)
        {
            var paramString = string.Empty;

            if (parameters != null)
            {
                paramString = parameters.Aggregate("", (current, param) => current + string.Format("&{0}={1}", param.Key, param.Value));
            }
            var queryString = string.Format("{0}?op={1}{2}", path, operation, paramString);

            return(new Uri(WebHdfsUri + queryString));
        }
        private Uri CreateRequestUri(WebHdfsOperation operation, string path, List <KeyValuePair <string, string> > parameters)
        {
            if (parameters == null)
            {
                parameters = new List <KeyValuePair <string, string> >();
            }

            parameters.Add(new KeyValuePair <string, string>(
                               HadoopRemoteRestConstants.UserName,
                               _authCredential.UserName.EscapeDataString()));

            string paramString = parameters.Aggregate("",
                                                      (current, param) => current + string.Format("&{0}={1}", param.Key, param.Value));

            var queryString = string.Format("{0}?op={1}{2}", path, operation, paramString);

            var uri = new Uri(_webHdfsUri + queryString);

            return(uri);
        }