class Google::Cloud::Bigtable::LongrunningJob
A resource representing the long-running, asynchronous processing operation. The job can be refreshed to retrieve the result object once the operation has been completed.
@see cloud.google.com/bigtable/docs/reference/admin/rpc/google.longrunning#google.longrunning.Operation
Long-running Operation
Attributes
@private The Gapic::Operation gRPC object.
@private The gRPC Service
object.
Public Class Methods
@private New BasicJob from a Gapic::Operation object.
# File lib/google/cloud/bigtable/longrunning_job.rb, line 113 def self.from_grpc grpc, service new.tap do |job| job.grpc = grpc job.service = service end end
Public Instance Methods
Checks if the processing of the instance operation is complete.
@return [boolean] `true` when complete, `false` otherwise.
# File lib/google/cloud/bigtable/longrunning_job.rb, line 56 def done? @grpc.done? end
The status when the operation associated with this job produced an error.
@return [Object, Google::Rpc::Status, nil] A status object with
the status code and message, or `nil` if no error occurred.
# File lib/google/cloud/bigtable/longrunning_job.rb, line 76 def error return nil unless error? @grpc.error end
Checks if the processing of the instance operation has errored.
@return [boolean] `true` when errored, `false` otherwise.
# File lib/google/cloud/bigtable/longrunning_job.rb, line 65 def error? @grpc.error? end
@private Gets the metadata object of the operation.
@return [Object, nil] `nil` if the operation is not complete.
# File lib/google/cloud/bigtable/longrunning_job.rb, line 105 def metadata return nil unless done? return nil unless @grpc.grpc_op.result == :response @grpc.metadata end
Reloads the job with current data from the long-running, asynchronous processing of an operation.
@return [Google::Cloud::Bigtable::Instance::Job] The same job instance.
# File lib/google/cloud/bigtable/longrunning_job.rb, line 87 def reload! @grpc.reload! self end
Gets the result object of the operation.
@return [Object, nil]
`nil` if the operation is not complete.
# File lib/google/cloud/bigtable/longrunning_job.rb, line 45 def results return nil unless done? return nil unless @grpc.grpc_op.result == :response @grpc.results end
Reloads the job until the operation is complete. The delay between reloads will incrementally increase.
# File lib/google/cloud/bigtable/longrunning_job.rb, line 96 def wait_until_done! @grpc.wait_until_done! end