/// <inheritdoc />
        public override BigQueryJob CancelJob(JobReference jobReference, CancelJobOptions options = null)
        {
            var request = CreateCancelJobRequest(jobReference, options);
            var result  = request.Execute();

            return(new BigQueryJob(this, result.Job));
        }
예제 #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 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));
        }
 /// <summary>
 /// Asynchronously cancels the specified job.
 /// </summary>
 /// <param name="jobReference">A fully-qualified identifier for the job. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>A task representing the asynchronous operation. When complete, the result is
 /// the final state of the job.</returns>
 public virtual Task <BigQueryJob> CancelJobAsync(JobReference jobReference, CancelJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) =>
 throw new NotImplementedException();
 /// <summary>
 /// Asynchronously cancels the specified job.
 /// This method just creates a <see cref="JobReference"/> and delegates to <see cref="CancelJobAsync(JobReference, CancelJobOptions, CancellationToken)"/>.
 /// </summary>
 /// <param name="projectId">The project ID. Must not be null.</param>
 /// <param name="jobId">The job ID. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>A task representing the asynchronous operation. When complete, the result is
 /// the final state of the job.</returns>
 public virtual Task <BigQueryJob> CancelJobAsync(string projectId, string jobId, CancelJobOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) =>
 CancelJobAsync(GetJobReference(projectId, jobId), options, cancellationToken);
 /// <summary>
 /// Cancels the specified job.
 /// </summary>
 /// <param name="jobReference">A fully-qualified identifier for the job. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>The final state of the job.</returns>
 public virtual BigQueryJob CancelJob(JobReference jobReference, CancelJobOptions options = null) =>
 throw new NotImplementedException();
 /// <summary>
 /// Cancels the specified job.
 /// This method just creates a <see cref="JobReference"/> and delegates to <see cref="CancelJob(JobReference, CancelJobOptions)"/>.
 /// </summary>
 /// <param name="projectId">The project ID. Must not be null.</param>
 /// <param name="jobId">The job ID. Must not be null.</param>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>The final state of the job.</returns>
 public virtual BigQueryJob CancelJob(string projectId, string jobId, CancelJobOptions options = null) =>
 CancelJob(GetJobReference(projectId, jobId), options);
        /// <inheritdoc />
        public override async Task <BigQueryJob> CancelJobAsync(JobReference jobReference, CancelJobOptions options = null,
                                                                CancellationToken cancellationToken = default)
        {
            var request = CreateCancelJobRequest(jobReference, options);
            var result  = await request.ExecuteAsync(cancellationToken).ConfigureAwait(false);

            return(new BigQueryJob(this, result.Job));
        }
예제 #9
0
 /// <summary>
 /// Asynchronously cancels this job.
 /// This method just creates a <see cref="JobReference"/> and delegates to <see cref="BigQueryClient.CancelJobAsync(JobReference, CancelJobOptions, CancellationToken)"/>.
 /// </summary>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
 /// <returns>A task representing the asynchronous operation. When complete, the result is
 /// the final state of the job.</returns>
 public Task <BigQueryJob> CancelAsync(CancelJobOptions options = null, CancellationToken cancellationToken = default) =>
 _client.CancelJobAsync(Reference, options, cancellationToken);
예제 #10
0
 /// <summary>
 /// Cancels this job.
 /// This method just creates a <see cref="JobReference"/> and delegates to <see cref="BigQueryClient.CancelJob(JobReference, CancelJobOptions)"/>.
 /// </summary>
 /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param>
 /// <returns>The final state of the job.</returns>
 public BigQueryJob Cancel(CancelJobOptions options = null) => _client.CancelJob(Reference, options);
        /// <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);

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

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