Class: Google::Cloud::Bigtable::Cluster
- Inherits:
-
Object
- Object
- Google::Cloud::Bigtable::Cluster
- Defined in:
- lib/google/cloud/bigtable/cluster.rb,
lib/google/cloud/bigtable/cluster/job.rb,
lib/google/cloud/bigtable/cluster/list.rb
Overview
Cluster
A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application.
Defined Under Namespace
Instance Method Summary collapse
-
#cluster_id ⇒ String
The unique identifier for the cluster.
-
#creating? ⇒ Boolean
The instance is currently being created, and may be destroyed if the creation process encounters an error.
-
#delete ⇒ Boolean
Permanently deletes the cluster.
-
#disabled? ⇒ Boolean
The cluster has no backing nodes.
-
#instance_id ⇒ String
The unique identifier for the instance.
-
#location ⇒ String
Cluster location.
-
#location_path ⇒ String
Cluster location path in form of
projects/<project_id>/locations/<zone>
. -
#nodes ⇒ Integer
The number of nodes allocated to this cluster.
-
#nodes=(serve_nodes) ⇒ Object
The number of nodes allocated to this cluster.
-
#path ⇒ String
The unique name of the cluster.
-
#project_id ⇒ String
The unique identifier for the project.
-
#ready? ⇒ Boolean
The cluster has been successfully created and is ready to serve requests.
-
#reload! ⇒ Google::Cloud::Bigtable::Cluster
Reload cluster information.
-
#resizing? ⇒ Boolean
The cluster is currently being resized, and may revert to its previous node count if the process encounters an error.
-
#save ⇒ Google::Cloud::Bigtable::Cluster::Job
(also: #update)
Update cluster.
-
#state ⇒ Symbol
The current instance state.
-
#storage_type ⇒ Symbol
The type of storage used by this cluster to serve its parent instance's tables, unless explicitly overridden.
Instance Method Details
#cluster_id ⇒ String
The unique identifier for the cluster.
74 75 76 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 74 def cluster_id @grpc.name.split("/")[5] end |
#creating? ⇒ Boolean
The instance is currently being created, and may be destroyed if the creation process encounters an error.
106 107 108 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 106 def creating? state == :CREATING end |
#delete ⇒ Boolean
Permanently deletes the cluster
234 235 236 237 238 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 234 def delete ensure_service! service.delete_cluster(instance_id, cluster_id) true end |
#disabled? ⇒ Boolean
The cluster has no backing nodes. The data (tables) still exist, but no operations can be performed on the cluster.
125 126 127 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 125 def disabled? state == :DISABLED end |
#instance_id ⇒ String
The unique identifier for the instance.
67 68 69 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 67 def instance_id @grpc.name.split("/")[3] end |
#location ⇒ String
Cluster location. i.e "us-east-1b"
158 159 160 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 158 def location @grpc.location.split("/")[3] end |
#location_path ⇒ String
Cluster location path in form of
projects/<project_id>/locations/<zone>
166 167 168 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 166 def location_path @grpc.location end |
#nodes ⇒ Integer
The number of nodes allocated to this cluster.
132 133 134 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 132 def nodes @grpc.serve_nodes end |
#nodes=(serve_nodes) ⇒ Object
The number of nodes allocated to this cluster. More nodes enable higher throughput and more consistent performance.
140 141 142 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 140 def nodes= serve_nodes @grpc.serve_nodes = serve_nodes end |
#path ⇒ String
The unique name of the cluster. Value in the form
projects/<project_id>/instances/<instance_id>/clusters/<cluster_id>
.
82 83 84 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 82 def path @grpc.name end |
#project_id ⇒ String
The unique identifier for the project.
60 61 62 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 60 def project_id @grpc.name.split("/")[1] end |
#ready? ⇒ Boolean
The cluster has been successfully created and is ready to serve requests.
98 99 100 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 98 def ready? state == :READY end |
#reload! ⇒ Google::Cloud::Bigtable::Cluster
Reload cluster information.
216 217 218 219 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 216 def reload! @grpc = service.get_cluster(instance_id, cluster_id) self end |
#resizing? ⇒ Boolean
The cluster is currently being resized, and may revert to its previous node count if the process encounters an error. A cluster is still capable of serving requests while being resized, but may exhibit performance as if its number of allocated nodes is between the starting and requested states.
117 118 119 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 117 def resizing? state == :RESIZING end |
#save ⇒ Google::Cloud::Bigtable::Cluster::Job Also known as: update
Update cluster.
Updatable fields are no of nodes.
200 201 202 203 204 205 206 207 208 209 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 200 def save ensure_service! grpc = service.update_cluster( instance_id, cluster_id, location_path, nodes ) Cluster::Job.from_grpc(grpc, service) end |
#state ⇒ Symbol
The current instance state.
Possible values are
:CREATING
, :READY
, :STATE_NOT_KNOWN
, :RESIZING
, :DISABLED
.
91 92 93 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 91 def state @grpc.state end |
#storage_type ⇒ Symbol
The type of storage used by this cluster to serve its
parent instance's tables, unless explicitly overridden.
Valid values are :SSD
(Flash (SSD) storage should be used),
:HDD
(Magnetic drive (HDD) storage should be used)
150 151 152 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 150 def storage_type @grpc.default_storage_type end |