Class: Google::Cloud::Spanner::Database::Job Deprecated
- Inherits:
-
Object
- Object
- Google::Cloud::Spanner::Database::Job
- Defined in:
- lib/google/cloud/spanner/database/job.rb,
lib/google/cloud/spanner/database/job/list.rb
Overview
Use the long-running operation returned by Admin::Database.database_admin.create_database instead.
Job
A resource representing the long-running, asynchronous processing of a database create or update operation. The job can be refreshed to retrieve the database object once the operation has been completed.
See Project#create_database and #update.
Defined Under Namespace
Classes: List
Instance Method Summary collapse
-
#database ⇒ Google::Cloud::Spanner::Database?
The database that is the object of the operation.
-
#done? ⇒ boolean
Checks if the processing of the database operation is complete.
-
#error ⇒ Google::Cloud::Spanner::Status?
The status if the operation associated with this job produced an error.
-
#error? ⇒ boolean
Checks if the processing of the database operation has errored.
-
#reload! ⇒ Google::Cloud::Spanner::Database::Job
(also: #refresh!)
Reloads the job with current data from the long-running, asynchronous processing of a database operation.
-
#wait_until_done! ⇒ Object
Reloads the job until the operation is complete.
Instance Method Details
#database ⇒ Google::Cloud::Spanner::Database?
The database that is the object of the operation.
94 95 96 97 98 99 |
# File 'lib/google/cloud/spanner/database/job.rb', line 94 def database return nil unless done? return nil unless @grpc.grpc_op.result == :response return nil unless @grpc.results.instance_of? Admin::Database::V1::Database Database.from_grpc @grpc.results, service end |
#done? ⇒ boolean
Checks if the processing of the database operation is complete.
116 117 118 |
# File 'lib/google/cloud/spanner/database/job.rb', line 116 def done? @grpc.done? end |
#error ⇒ Google::Cloud::Spanner::Status?
The status if the operation associated with this job produced an error.
158 159 160 161 |
# File 'lib/google/cloud/spanner/database/job.rb', line 158 def error return nil unless error? Google::Cloud::Spanner::Status.from_grpc @grpc.error end |
#error? ⇒ boolean
Checks if the processing of the database operation has errored.
135 136 137 |
# File 'lib/google/cloud/spanner/database/job.rb', line 135 def error? @grpc.error? end |
#reload! ⇒ Google::Cloud::Spanner::Database::Job Also known as: refresh!
Reloads the job with current data from the long-running, asynchronous processing of a database operation.
182 183 184 185 |
# File 'lib/google/cloud/spanner/database/job.rb', line 182 def reload! @grpc.reload! self end |
#wait_until_done! ⇒ Object
Reloads the job until the operation is complete. The delay between reloads will incrementally increase.
204 205 206 |
# File 'lib/google/cloud/spanner/database/job.rb', line 204 def wait_until_done! @grpc.wait_until_done! end |