/// <summary> /// An optional partial-method to perform custom initialization. /// </summary> partial void CustomInitialize() { // Having Http client time same as MaxBackOff seems to be not sufficient. This is still // raising TaskCancellation Exception. Setting value MaxBackOff + 2 mins for HDinsight // gateway time and having 1 min extra buffer. this.HttpClient.Timeout = MaxBackOff.Add(TimeSpan.FromMinutes(3)); }
/// <summary> /// Initializes a new instance of the HDInsightJobManagementClient /// class. /// </summary> /// <param name='clusterDnsName'> /// Required. The cluster dns name against which the job management is /// to be performed. /// </param> /// <param name='credentials'> /// Required. Basic authentication credentials for job submission. /// </param> /// <param name='retryPolicy'> /// Optional. Retry Policy for Http Transient errors. /// </param> public HDInsightJobManagementClient(string clusterDnsName, BasicAuthenticationCloudCredentials credentials, RetryPolicy retryPolicy = null) : this(clusterDnsName, credentials) { if (retryPolicy == null) { // If No retry policy is provided then use default retry policy retryPolicy = HDInsightJobManagementClient.HDInsightRetryPolicy; // Having Http client time same as MaxBackOff seems to be not sufficient. This is still // raising TaskCancellation Exception. Setting value MaxBackOff + 2 mins for HDinsight // gateway time and having 1 min extra buffer. this.HttpClient.Timeout = MaxBackOff.Add(TimeSpan.FromMinutes(3)); } this.SetRetryPolicy(retryPolicy); }