Class: Google::Cloud::Bigtable::LongrunningJob

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/bigtable/longrunning_job.rb

Overview

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.

Direct Known Subclasses

AppProfile::Job, Cluster::Job, Instance::Job

Instance Method Summary collapse

Instance Method Details

#done?boolean

Checks if the processing of the instance operation is complete.

Returns:

  • (boolean)

    true when complete, false otherwise.



53
54
55
# File 'lib/google/cloud/bigtable/longrunning_job.rb', line 53

def done?
  @grpc.done?
end

#errorObject, ...

The status if the operation associated with this job produced an error.

Returns:

  • (Object, Google::Rpc::Status, nil)

    A status object with the status code and message, or nil if no error occurred.



72
73
74
75
# File 'lib/google/cloud/bigtable/longrunning_job.rb', line 72

def error
  return nil unless error?
  @grpc.error
end

#error?boolean

Checks if the processing of the instance operation has errored.

Returns:

  • (boolean)

    true when errored, false otherwise.



61
62
63
# File 'lib/google/cloud/bigtable/longrunning_job.rb', line 61

def error?
  @grpc.error?
end

#reload!Google::Cloud::Bigtable::Instance::Job

Reloads the job with current data from the long-running, asynchronous processing of an operation.

Returns:



82
83
84
85
# File 'lib/google/cloud/bigtable/longrunning_job.rb', line 82

def reload!
  @grpc.reload!
  self
end

#resultsObject?

Get result object of the operation.

Returns:

  • (Object, nil)

    nil if the operation is not complete.



43
44
45
46
47
# File 'lib/google/cloud/bigtable/longrunning_job.rb', line 43

def results
  return nil unless done?
  return nil unless @grpc.grpc_op.result == :response
  @grpc.results
end

#wait_until_done!Object

Reloads the job until the operation is complete. The delay between reloads will incrementally increase.



90
91
92
# File 'lib/google/cloud/bigtable/longrunning_job.rb', line 90

def wait_until_done!
  @grpc.wait_until_done!
end