Class CreateClusterRequest (2.5.3)

public final class CreateClusterRequest

Parameters for creating a new Bigtable cluster.

A cluster represents the actual Cloud Bigtable service. Each cluster belongs to a single Cloud Bigtable instance. When your application sends requests to a Cloud Bigtable instance, those requests are actually handled by one of the clusters in the instance.

Each cluster is located in a single zone. An instance's clusters must be in unique zones that are within the same region. For example, if the first cluster is in us-east1-b, then us-east1-c is a valid zone for the second cluster. For a list of zones and regions where Cloud Bigtable is available, see Cloud Bigtable Locations.

Examples:


 // Small production instance:
 CreateClusterRequest clusterRequest = CreateClusterRequest.of("my-existing-instance", "my-cluster")
   .setZone("us-east1-c")
   .setServeNodes(3)
   .setStorageType(StorageType.SSD);
 

See Also: For more details

Inheritance

java.lang.Object > CreateClusterRequest

Static Methods

of(String instanceId, String clusterId)

public static CreateClusterRequest of(String instanceId, String clusterId)

Builds a new request to create a new cluster to the specified instance with the specified cluster id.

Parameters
NameDescription
instanceIdString
clusterIdString
Returns
TypeDescription
CreateClusterRequest

Methods

setKmsKeyName(String kmsKeyName)

public CreateClusterRequest setKmsKeyName(String kmsKeyName)

Sets the Google Cloud Key Management Service (KMS) key for a CMEK-protected Bigtable. This requires the full resource name of the Cloud KMS key, in the format projects/{key_project_id}/locations/{location}/keyRings/{ring_name}/cryptoKeys/{key_name}

Parameter
NameDescription
kmsKeyNameString
Returns
TypeDescription
CreateClusterRequest

setScalingMode(ClusterAutoscalingConfig autoscalingConfig)

public CreateClusterRequest setScalingMode(ClusterAutoscalingConfig autoscalingConfig)

Sets the scaling mode to autoscaling by accepting an AutoscalingConfig where min nodes, max nodes, and CPU utlization percent target are set.

Parameter
NameDescription
autoscalingConfigClusterAutoscalingConfig
Returns
TypeDescription
CreateClusterRequest

setScalingMode(StaticClusterSize staticClusterSize)

public CreateClusterRequest setScalingMode(StaticClusterSize staticClusterSize)

Sets the scaling node to manual and sets the number of nodes allocated to this cluster. More nodes enable higher throughput and more consistent performance.

Parameter
NameDescription
staticClusterSizeStaticClusterSize
Returns
TypeDescription
CreateClusterRequest

setServeNodes(int numNodes) (deprecated)

public CreateClusterRequest setServeNodes(int numNodes)

Deprecated. Please use CreateClusterRequest#setScalingMode instead

Sets the number of nodes allocated to this cluster. More nodes enable higher throughput and more consistent performance.

Parameter
NameDescription
numNodesint
Returns
TypeDescription
CreateClusterRequest

setStorageType(StorageType storageType)

public CreateClusterRequest setStorageType(StorageType storageType)

Sets the type of storage used by this cluster to serve its parent instance's tables. Defaults to SSD.

Parameter
NameDescription
storageTypeStorageType
Returns
TypeDescription
CreateClusterRequest

setZone(String zone)

public CreateClusterRequest setZone(String zone)

Sets the zone where the new cluster will be located. Must be different from the existing cluster.

Parameter
NameDescription
zoneString
Returns
TypeDescription
CreateClusterRequest

toProto(String projectId)

public CreateClusterRequest toProto(String projectId)

Creates the request protobuf. This method is considered an internal implementation detail and not meant to be used by applications.

Parameter
NameDescription
projectIdString
Returns
TypeDescription
CreateClusterRequest