class Google::Cloud::Bigtable::Table::RestoreJob
A resource representing the long-running, asynchronous processing of a backup restore operation. The job can be refreshed to retrieve the table object once the operation has been completed.
See {Backup#restore}.
@see cloud.google.com/bigtable/docs/reference/admin/rpc/google.longrunning#google.longrunning.Operation
Long-running Operation
@example
require "google/cloud/bigtable" bigtable = Google::Cloud::Bigtable.new instance = bigtable.instance "my-instance" cluster = instance.cluster "my-cluster" backup = cluster.backup "my-backup" job = backup.restore "my-new-table" job.wait_until_done! job.done? #=> true if job.error? status = job.error else table = job.table optimized = job.optimize_table_operation_name end
Public Instance Methods
optimize_table_operation_name()
click to toggle source
The optimize table operation name from operation metadata.
@return [String, nil] The optimize table operation name, or `nil` if the optimize table operation is not
complete.
@example
require "google/cloud/bigtable" bigtable = Google::Cloud::Bigtable.new instance = bigtable.instance "my-instance" cluster = instance.cluster "my-cluster" backup = cluster.backup "my-backup" job = backup.restore "my-new-table" job.wait_until_done! job.done? #=> true if job.error? status = job.error else table = job.table optimized = job.optimize_table_operation_name end
# File lib/google/cloud/bigtable/table/restore_job.rb, line 80 def optimize_table_operation_name metadata.optimize_table_operation_name end
table()
click to toggle source
Gets the table object from operation results.
@return [Google::Cloud::Bigtable::Table, nil] The table instance, or `nil` if the operation is not complete.
@example
require "google/cloud/bigtable" bigtable = Google::Cloud::Bigtable.new instance = bigtable.instance "my-instance" cluster = instance.cluster "my-cluster" backup = cluster.backup "my-backup" job = backup.restore "my-new-table" job.wait_until_done! job.done? #=> true if job.error? status = job.error else table = job.table optimized = job.optimize_table_operation_name end
# File lib/google/cloud/bigtable/table/restore_job.rb, line 110 def table Table.from_grpc results, service, view: :NAME_ONLY if results end