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.

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.



56
57
58
# File 'lib/google/cloud/bigtable/longrunning_job.rb', line 56

def done?
  @grpc.done?
end

#errorObject, ...

The status when 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.



76
77
78
79
# File 'lib/google/cloud/bigtable/longrunning_job.rb', line 76

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.



65
66
67
# File 'lib/google/cloud/bigtable/longrunning_job.rb', line 65

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:



87
88
89
90
# File 'lib/google/cloud/bigtable/longrunning_job.rb', line 87

def reload!
  @grpc.reload!
  self
end

#resultsObject?

Gets the result object of the operation.

Returns:

  • (Object, nil)

    nil if the operation is not complete.



45
46
47
48
49
# 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

#wait_until_done!Object

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



96
97
98
# File 'lib/google/cloud/bigtable/longrunning_job.rb', line 96

def wait_until_done!
  @grpc.wait_until_done!
end