/// <inheritdoc />
        public override BigQueryJob CancelJob(JobReference jobReference, CancelJobOptions options = null)
        {
            GaxPreconditions.CheckNotNull(jobReference, nameof(jobReference));
            var request = Service.Jobs.Cancel(jobReference.ProjectId, jobReference.JobId);

            options?.ModifyRequest(request);
            var result = request.Execute();

            return(new BigQueryJob(this, result.Job));
        }
Esempio n. 2
0
        private CancelRequest CreateCancelJobRequest(JobReference jobReference, CancelJobOptions options)
        {
            GaxPreconditions.CheckNotNull(jobReference, nameof(jobReference));
            var request = Service.Jobs.Cancel(jobReference.ProjectId, jobReference.JobId);

            request.ModifyRequest += _versionHeaderAction;
            options?.ModifyRequest(request);
            RetryHandler.MarkAsRetriable(request);
            return(request);
        }
        /// <inheritdoc />
        public override async Task <BigQueryJob> CancelJobAsync(JobReference jobReference, CancelJobOptions options = null,
                                                                CancellationToken cancellationToken = default(CancellationToken))
        {
            GaxPreconditions.CheckNotNull(jobReference, nameof(jobReference));
            var request = Service.Jobs.Cancel(jobReference.ProjectId, jobReference.JobId);

            options?.ModifyRequest(request);
            var result = await request.ExecuteAsync(cancellationToken).ConfigureAwait(false);

            return(new BigQueryJob(this, result.Job));
        }