Cloud Bigtable API - Class Google::Cloud::Bigtable::Table::RestoreJob (v2.10.1)

Reference documentation and code samples for the Cloud Bigtable API class Google::Cloud::Bigtable::Table::RestoreJob.

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.

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

Methods

#optimize_table_operation_name

def optimize_table_operation_name() -> String, nil

The optimize table operation name from operation metadata.

Returns
  • (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

#table

def table() -> Google::Cloud::Bigtable::Table, nil

Gets the table object from operation results.

Returns
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