Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions google-cloud-bigtable/lib/google/cloud/bigtable/backup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module Bigtable
#
# # Delete
# backup.delete
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
class Backup
# @private
Expand Down Expand Up @@ -159,6 +160,7 @@ def expire_time
# delete the backup and free the resources used by the backup.
#
# @param [Time] new_expire_time The new expiration time of the backup.
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def expire_time= new_expire_time
@grpc.expire_time = Convert.time_to_timestamp new_expire_time
Expand Down Expand Up @@ -278,6 +280,7 @@ def encryption_info
# backup.policy do |p|
# p.add "roles/owner", "user:owner@example.com"
# end # 2 API calls
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def policy
ensure_service!
Expand Down Expand Up @@ -316,6 +319,7 @@ def policy
# updated_policy = backup.update_policy policy
#
# puts updated_policy.roles
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def update_policy new_policy
ensure_service!
Expand Down Expand Up @@ -353,6 +357,7 @@ def update_policy new_policy
# )
# permissions.include? "bigtable.backups.delete" #=> false
# permissions.include? "bigtable.backups.get" #=> true
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def test_iam_permissions *permissions
ensure_service!
Expand Down Expand Up @@ -413,6 +418,7 @@ def test_iam_permissions *permissions
# table = job.table
# optimized = job.optimize_table_operation_name
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def restore table_id, instance: nil
table_instance_id = instance.respond_to?(:instance_id) ? instance.instance_id : instance
Expand Down Expand Up @@ -468,6 +474,7 @@ def restore table_id, instance: nil
# else
# backup = job.backup
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def copy dest_project_id:, dest_instance_id:, dest_cluster_id:, new_backup_id:, expire_time:
grpc = service.copy_backup project_id: dest_project_id,
Expand Down Expand Up @@ -498,6 +505,7 @@ def copy dest_project_id:, dest_instance_id:, dest_cluster_id:, new_backup_id:,
# # Update
# backup.expire_time = Time.now + 60 * 60 * 7
# backup.save
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def save
ensure_service!
Expand All @@ -510,6 +518,7 @@ def save
# Reloads backup data.
#
# @return [Google::Cloud::Bigtable::Backup]
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def reload!
@grpc = service.get_backup instance_id, cluster_id, backup_id
Expand All @@ -531,6 +540,7 @@ def reload!
# backup = cluster.backup "my-backup"
#
# backup.delete
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def delete
ensure_service!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module Bigtable
#
# column_family = table.column_families["cf2"]
# puts column_family.gc_rule
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
class ColumnFamily
##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ module Bigtable
# end
#
# puts table.column_families["cf3"] #=> nil
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
class ColumnFamilyMap
include Enumerable
Expand Down Expand Up @@ -202,6 +203,7 @@ def empty?
# column_families.add "cf4", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600)
# column_families.add "cf5", gc_rule: Google::Cloud::Bigtable::GcRule.max_versions(5)
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def add name, positional_gc_rule = nil, gc_rule: nil
raise ArgumentError, "column family #{name.inspect} already exists" if @column_families.has_key? name
Expand Down Expand Up @@ -246,6 +248,7 @@ def add name, positional_gc_rule = nil, gc_rule: nil
#
# column_families.update "cf2", gc_rule: rule_union
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def update name, gc_rule: nil
raise ArgumentError, "column family #{name.inspect} does not exist" unless @column_families.has_key? name
Expand Down Expand Up @@ -275,6 +278,7 @@ def update name, gc_rule: nil
# table.column_families do |column_families|
# column_families.delete "cf3"
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def delete name
raise ArgumentError, "column family #{name.inspect} does not exist" unless @column_families.has_key? name
Expand Down
5 changes: 5 additions & 0 deletions google-cloud-bigtable/lib/google/cloud/bigtable/gc_rule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ module Bigtable
# puts table.column_families["cf1"].gc_rule.max_versions
# puts table.column_families["cf2"].gc_rule.max_age
# puts table.column_families["cf3"].gc_rule.union
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
class GcRule
# @private
Expand Down Expand Up @@ -234,6 +235,7 @@ def union
# table = bigtable.create_table "my-instance", "my-table" do |cfm|
# cfm.add "cf1", gc_rule: Google::Cloud::Bigtable::GcRule.max_versions(5)
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def self.max_versions versions
new.tap do |gc_rule|
Expand All @@ -255,6 +257,7 @@ def self.max_versions versions
# table = bigtable.create_table "my-instance", "my-table" do |cfm|
# cfm.add "cf1", gc_rule: Google::Cloud::Bigtable::GcRule.max_age(600)
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def self.max_age age
new.tap do |gc_rule|
Expand All @@ -281,6 +284,7 @@ def self.max_age age
# )
# cfm.add "cf1", gc_rule: gc_rule
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def self.union *rules
new.tap do |gc_rule|
Expand All @@ -307,6 +311,7 @@ def self.union *rules
# )
# cfm.add "cf1", gc_rule: gc_rule
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def self.intersection *rules
new.tap do |gc_rule|
Expand Down
16 changes: 16 additions & 0 deletions google-cloud-bigtable/lib/google/cloud/bigtable/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def path
# * `:FULL` - Populates all fields.
#
# @return [Google::Cloud::Bigtable::Table]
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def reload! view: nil
view ||= :SCHEMA_VIEW
Expand Down Expand Up @@ -167,6 +168,7 @@ def reload! view: nil
# puts cs.replication_state
# puts cs.encryption_infos.first.encryption_type
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def cluster_states
check_view_and_load :FULL, skip_if: [:ENCRYPTION_VIEW, :REPLICATION_VIEW]
Expand Down Expand Up @@ -239,6 +241,7 @@ def cluster_states
# end
#
# puts table.column_families["cf3"] #=> nil
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def column_families
check_view_and_load :SCHEMA_VIEW
Expand All @@ -263,6 +266,7 @@ def column_families
# or `FULL`. Previously loaded data is retained.
#
# @return [Symbol]
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def granularity
check_view_and_load :SCHEMA_VIEW
Expand All @@ -273,6 +277,7 @@ def granularity
# The table keeps data versioned at a granularity of 1 ms.
#
# @return [Boolean]
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def granularity_millis?
granularity == :MILLIS
Expand Down Expand Up @@ -311,6 +316,7 @@ def granularity_millis?
# table.policy do |p|
# p.add "roles/owner", "user:owner@example.com"
# end # 2 API calls
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def policy
ensure_service!
Expand Down Expand Up @@ -347,6 +353,7 @@ def policy
# updated_policy = table.update_policy policy
#
# puts updated_policy.roles
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def update_policy new_policy
ensure_service!
Expand Down Expand Up @@ -382,6 +389,7 @@ def update_policy new_policy
# )
# permissions.include? "bigtable.tables.delete" #=> false
# permissions.include? "bigtable.tables.get" #=> true
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def test_iam_permissions *permissions
ensure_service!
Expand All @@ -401,6 +409,7 @@ def test_iam_permissions *permissions
#
# table = bigtable.table "my-instance", "my-table"
# table.delete
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def delete
ensure_service!
Expand Down Expand Up @@ -439,6 +448,7 @@ def delete
# else
# p "Table does not exist"
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def exists?
!service.get_table(instance_id, name, view: :NAME_ONLY).nil?
Expand Down Expand Up @@ -495,6 +505,7 @@ def self.create service, instance_id, table_id, column_families: nil, granularit
# table = instance.table "my-table"
#
# table.generate_consistency_token # "l947XelENinaxJQP0nnrZJjHnAF7YrwW8HCJLotwrF"
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def generate_consistency_token
ensure_service!
Expand Down Expand Up @@ -522,6 +533,7 @@ def generate_consistency_token
# if table.check_consistency token
# puts "Replication is consistent"
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def check_consistency token
ensure_service!
Expand Down Expand Up @@ -558,6 +570,7 @@ def check_consistency token
# if table.wait_for_replication timeout: 300, check_interval: 10
# puts "Replication done"
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def wait_for_replication timeout: 600, check_interval: 5
raise InvalidArgumentError, "'check_interval' cannot be greater than timeout" if check_interval > timeout
Expand Down Expand Up @@ -593,6 +606,7 @@ def wait_for_replication timeout: 600, check_interval: 5
#
# # With timeout
# table.delete_all_rows timeout: 120 # 120 seconds.
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def delete_all_rows timeout: nil
drop_row_range delete_all_data: true, timeout: timeout
Expand All @@ -615,6 +629,7 @@ def delete_all_rows timeout: nil
#
# # With timeout
# table.delete_rows_by_prefix "user-1", timeout: 120 # 120 seconds.
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def delete_rows_by_prefix prefix, timeout: nil
drop_row_range row_key_prefix: prefix, timeout: timeout
Expand All @@ -640,6 +655,7 @@ def delete_rows_by_prefix prefix, timeout: nil
#
# # Delete all data With timeout
# table.drop_row_range delete_all_data: true, timeout: 120 # 120 seconds.
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
def drop_row_range row_key_prefix: nil, delete_all_data: nil, timeout: nil
ensure_service!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Table
# puts cs.replication_state
# puts cs.encryption_infos.first.encryption_type
# end
# @deprecated Use {Google::Cloud::Bigtable::Project#table_admin_client} instead.
#
class ClusterState
attr_reader :cluster_name
Expand Down
Loading