Hadoop.Client/Jobs/WebHCatalog/Data/JsonPayloadConverterBase.cs
/// <summary>
/// Creates the payload for a Streaming MapReduce request.
/// </summary>
/// <param name="userName">
/// The user name.
/// </param>
/// <param name="details">
/// The details.
/// </param>
/// <returns>
/// A string that represents the payload for the request.
/// </returns>
Creates the payload for a Streaming MapReduce request.
Creates the payload for a Streaming MapReduce request .
public string SerializeStreamingMapReduceRequest(string userName, StreamingMapReduceJobCreateParameters details)
        {
            var values = new List<KeyValuePair<string, string>>();
            values.Add(new KeyValuePair<string, string>(WebHCatConstants.Input, details.Input));
            values.Add(new KeyValuePair<string, string>(WebHCatConstants.Output, details.Output));
            values.Add(new KeyValuePair<string, string>(WebHCatConstants.Mapper, details.Mapper));
            if (details.Reducer.IsNullOrEmpty())
            {
                values.Add(new KeyValuePair<string, string>(WebHCatConstants.Reducer, NoneReducer));
            }
            else
            {
                values.Add(new KeyValuePair<string, string>(WebHCatConstants.Reducer, details.Reducer));
            }
            values.AddRange(this.SerializeJobRequest(userName, details, details.JobName, details.Arguments, details.Defines));
            values.AddRange(this.BuildList(WebHCatConstants.CmdEnv, details.CommandEnvironment));
            var retval = this.ConvertItems(values.Where(kvp => kvp.Value != null));
            return retval;
        }
public string SerializeStreamingMapReduceRequest ( string userName , StreamingMapReduceJobCreateParameters details ) { var values = new List < KeyValuePair < string , string > > ( ) ; values . Add ( new KeyValuePair < string , string > ( WebHCatConstants . Input , details . Input ) ) ; values . Add ( new KeyValuePair < string , string > ( WebHCatConstants . Output , details . Output ) ) ; values . Add ( new KeyValuePair < string , string > ( WebHCatConstants . Mapper , details . Mapper ) ) ; if ( details . Reducer . IsNullOrEmpty ( ) ) { values . Add ( new KeyValuePair < string , string > ( WebHCatConstants . Reducer , NoneReducer ) ) ; } else { values . Add ( new KeyValuePair < string , string > ( WebHCatConstants . Reducer , details . Reducer ) ) ; } values . AddRange ( this . SerializeJobRequest ( userName , details , details . JobName , details . Arguments , details . Defines ) ) ; values . AddRange ( this . BuildList ( WebHCatConstants . CmdEnv , details . CommandEnvironment ) ) ; var retval = this . ConvertItems ( values . Where ( kvp => kvp . Value != null ) ) ; return retval ; }
Creates the payload for a Streaming MapReduce request.
Creates the payload for a Streaming MapReduce request .
//details.ArgumentNotNull("details");
A string that represents the payload for the request.
A string that represents the payload for the request .
userName
string
The user name.
The user name .
details
StreamingMapReduceJobCreateParameters
None