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
Reloads 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.
81 82 83 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 81 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.
121 122 123 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 121 def creating? state == :CREATING end |
#delete ⇒ Boolean
Permanently deletes the cluster.
261 262 263 264 265 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 261 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.
144 145 146 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 144 def disabled? state == :DISABLED end |
#instance_id ⇒ String
The unique identifier for the instance.
72 73 74 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 72 def instance_id @grpc.name.split("/")[3] end |
#location ⇒ String
Cluster location. For example, "us-east1-b"
185 186 187 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 185 def location @grpc.location.split("/")[3] end |
#location_path ⇒ String
Cluster location path in form of
projects/<project_id>/locations/<zone>
195 196 197 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 195 def location_path @grpc.location end |
#nodes ⇒ Integer
The number of nodes allocated to this cluster.
153 154 155 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 153 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.
163 164 165 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 163 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>
.
91 92 93 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 91 def path @grpc.name end |
#project_id ⇒ String
The unique identifier for the project.
63 64 65 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 63 def project_id @grpc.name.split("/")[1] end |
#ready? ⇒ Boolean
The cluster has been successfully created and is ready to serve requests.
111 112 113 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 111 def ready? state == :READY end |
#reload! ⇒ Google::Cloud::Bigtable::Cluster
Reloads cluster information.
242 243 244 245 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 242 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 perform as if its number of allocated nodes is between the starting and requested states.
134 135 136 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 134 def resizing? state == :RESIZING end |
#save ⇒ Google::Cloud::Bigtable::Cluster::Job Also known as: update
Update cluster.
serve_nodes
is the only updatable field
230 231 232 233 234 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 230 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
.
102 103 104 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 102 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)
175 176 177 |
# File 'lib/google/cloud/bigtable/cluster.rb', line 175 def storage_type @grpc.default_storage_type end |