Class: Google::Cloud::Bigtable::Table::ClusterState

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/bigtable/table/cluster_state.rb

Overview

Table::ClusterState is the state of a table's data in a particular cluster.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cluster_nameString

The name of the cluster.

Returns:

  • (String)

    the current value of cluster_name



26
27
28
# File 'lib/google/cloud/bigtable/table/cluster_state.rb', line 26

def cluster_name
  @cluster_name
end

Instance Method Details

#initializing?Boolean

The cluster was recently created, and the table must finish copying over pre-existing data from other clusters before it can begin receiving live replication updates and serving.

Returns:

  • (Boolean)

    true if the table in this cluster is initializing.



62
63
64
# File 'lib/google/cloud/bigtable/table/cluster_state.rb', line 62

def initializing?
  replication_state == :INITIALIZING
end

#planned_maintenance?Boolean

The table is temporarily unable to serve requests from this cluster due to planned internal maintenance.

Returns:

  • (Boolean)

    true if the table in this cluster is in planned maintenance.



73
74
75
# File 'lib/google/cloud/bigtable/table/cluster_state.rb', line 73

def planned_maintenance?
  replication_state == :PLANNED_MAINTENANCE
end

#ready?Boolean

The table can serve requests from this cluster. Depending on replication delay, reads may not immediately reflect the state of the table in other clusters.

Returns:

  • (Boolean)

    true if the table in this cluster is ready.



95
96
97
# File 'lib/google/cloud/bigtable/table/cluster_state.rb', line 95

def ready?
  replication_state == :READY
end

#ready_optimizing?Boolean

The table is fully created and ready for use after a restore, and is being optimized for performance. When optimizations are complete, the table will transition to READY state.

Returns:

  • (Boolean)

    true if the table in this cluster is being optimized.



108
109
110
# File 'lib/google/cloud/bigtable/table/cluster_state.rb', line 108

def ready_optimizing?
  replication_state == :READY_OPTIMIZING
end

#replication_stateSymbol

The state of replication for the table in this cluster. Valid values are:

  • :INITIALIZING - The cluster was recently created.
  • :PLANNED_MAINTENANCE - The table is temporarily unable to serve.
  • :UNPLANNED_MAINTENANCE - The table is temporarily unable to serve.
  • :READY - The table can serve.
  • :READY_OPTIMIZING - The table is fully created and ready for use after a restore, and is being optimized for performance. When optimizations are complete, the table will transition to READY state.

Returns:

  • (Symbol)

    The state of replication.



51
52
53
# File 'lib/google/cloud/bigtable/table/cluster_state.rb', line 51

def replication_state
  @grpc.replication_state
end

#unplanned_maintenance?Boolean

The table is temporarily unable to serve requests from this cluster due to unplanned or emergency maintenance.

Returns:

  • (Boolean)

    true if the table in this cluster is in unplanned maintenance.



84
85
86
# File 'lib/google/cloud/bigtable/table/cluster_state.rb', line 84

def unplanned_maintenance?
  replication_state == :UNPLANNED_MAINTENANCE
end