/// <inheritdoc /> public async Task<HadoopJobCreationResults> SubmitMapReduceJob(HadoopMapReduceJobCreationDetails details) { JobPayloadConverter converter = new JobPayloadConverter(); using (var client = ServiceLocator.Instance.Locate<IHDInsightJobSubmissionRestClientFactory>().Create(this.credentials)) { var payload = converter.SerializeJobCreationDetails(details); var result = await client.CreateJob(dnsName, location, payload); return converter.DeserializeJobCreationResults(result.Content); } }
public void WhenISerializeTheListOfJobIds() { var serverConverter = new JobPayloadServerConverter(); var clientConverter = new JobPayloadConverter(); var asList = this.transferObject.As<JobList>(); if (asList.IsNotNull()) { this.serializedForm = serverConverter.SerializeJobList(asList); return; } var asDetail = this.transferObject.As<Hadoop.Client.JobDetails>(); if (asDetail.IsNotNull()) { this.serializedForm = serverConverter.SerializeJobDetails(asDetail); return; } var asRequest = this.transferObject.As<JobCreateParameters>(); if (asRequest.IsNotNull()) { this.serializedForm = clientConverter.SerializeJobCreationDetails(asRequest); return; } Assert.Fail("Unable to recognize the object type."); }