diff --git a/protos/google/bigtable/admin/v2/instance.proto b/protos/google/bigtable/admin/v2/instance.proto index 188dae7eb..d6a3c861a 100644 --- a/protos/google/bigtable/admin/v2/instance.proto +++ b/protos/google/bigtable/admin/v2/instance.proto @@ -172,6 +172,21 @@ message Cluster { DISABLED = 4; } + // Possible node scaling factors of the clusters. Node scaling delivers better + // latency and more throughput by removing node boundaries. + enum NodeScalingFactor { + // No node scaling specified. Defaults to NODE_SCALING_FACTOR_1X. + NODE_SCALING_FACTOR_UNSPECIFIED = 0; + + // The cluster is running with a scaling factor of 1. + NODE_SCALING_FACTOR_1X = 1; + + // The cluster is running with a scaling factor of 2. + // All node count values must be in increments of 2 with this scaling factor + // enabled, otherwise an INVALID_ARGUMENT error will be returned. + NODE_SCALING_FACTOR_2X = 2; + } + // Autoscaling config for a cluster. message ClusterAutoscalingConfig { // Required. Autoscaling limits for this cluster. @@ -229,6 +244,10 @@ message Cluster { // throughput and more consistent performance. int32 serve_nodes = 4; + // Immutable. The node scaling factor of this cluster. + NodeScalingFactor node_scaling_factor = 9 + [(google.api.field_behavior) = IMMUTABLE]; + oneof config { // Configuration for this cluster. ClusterConfig cluster_config = 7; @@ -258,9 +277,34 @@ message AppProfile { // equidistant. Choosing this option sacrifices read-your-writes consistency // to improve availability. message MultiClusterRoutingUseAny { + // If enabled, Bigtable will route the request based on the row key of the + // request, rather than randomly. Instead, each row key will be assigned + // to a cluster, and will stick to that cluster. If clusters are added or + // removed, then this may affect which row keys stick to which clusters. + // To avoid this, users can use a cluster group to specify which clusters + // are to be used. In this case, new clusters that are not a part of the + // cluster group will not be routed to, and routing will be unaffected by + // the new cluster. Moreover, clusters specified in the cluster group cannot + // be deleted unless removed from the cluster group. + message RowAffinity {} + // The set of clusters to route to. The order is ignored; clusters will be // tried in order of distance. If left empty, all clusters are eligible. repeated string cluster_ids = 1; + + // Possible algorithms for routing affinity. If enabled, Bigtable will + // route between equidistant clusters in a deterministic order rather than + // choosing randomly. + // + // This mechanism gives read-your-writes consistency for *most* requests + // under *most* circumstances, without sacrificing availability. Consistency + // is *not* guaranteed, as requests might still fail over between clusters + // in the event of errors or latency. + oneof affinity { + // Row affinity sticky routing based on the row key of the request. + // Requests that span multiple rows are routed non-deterministically. + RowAffinity row_affinity = 3; + } } // Unconditionally routes all read/write requests to a specific cluster. diff --git a/protos/google/bigtable/v2/feature_flags.proto b/protos/google/bigtable/v2/feature_flags.proto index e97f23e15..d4c3bdbd7 100644 --- a/protos/google/bigtable/v2/feature_flags.proto +++ b/protos/google/bigtable/v2/feature_flags.proto @@ -61,4 +61,10 @@ message FeatureFlags { // Notify the server that the client has client side metrics enabled. bool client_side_metrics_enabled = 8; + + // Notify the server that the client using Traffic Director endpoint. + bool traffic_director_enabled = 9; + + // Notify the server that the client explicitly opted in for Direct Access. + bool direct_access_requested = 10; } diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 0eedaa428..0dd3af01e 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -3736,6 +3736,9 @@ export namespace google { /** Cluster serveNodes */ serveNodes?: (number|null); + /** Cluster nodeScalingFactor */ + nodeScalingFactor?: (google.bigtable.admin.v2.Cluster.NodeScalingFactor|keyof typeof google.bigtable.admin.v2.Cluster.NodeScalingFactor|null); + /** Cluster clusterConfig */ clusterConfig?: (google.bigtable.admin.v2.Cluster.IClusterConfig|null); @@ -3767,6 +3770,9 @@ export namespace google { /** Cluster serveNodes. */ public serveNodes: number; + /** Cluster nodeScalingFactor. */ + public nodeScalingFactor: (google.bigtable.admin.v2.Cluster.NodeScalingFactor|keyof typeof google.bigtable.admin.v2.Cluster.NodeScalingFactor); + /** Cluster clusterConfig. */ public clusterConfig?: (google.bigtable.admin.v2.Cluster.IClusterConfig|null); @@ -3868,6 +3874,13 @@ export namespace google { DISABLED = 4 } + /** NodeScalingFactor enum. */ + enum NodeScalingFactor { + NODE_SCALING_FACTOR_UNSPECIFIED = 0, + NODE_SCALING_FACTOR_1X = 1, + NODE_SCALING_FACTOR_2X = 2 + } + /** Properties of a ClusterAutoscalingConfig. */ interface IClusterAutoscalingConfig { @@ -4318,6 +4331,9 @@ export namespace google { /** MultiClusterRoutingUseAny clusterIds */ clusterIds?: (string[]|null); + + /** MultiClusterRoutingUseAny rowAffinity */ + rowAffinity?: (google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity|null); } /** Represents a MultiClusterRoutingUseAny. */ @@ -4332,6 +4348,12 @@ export namespace google { /** MultiClusterRoutingUseAny clusterIds. */ public clusterIds: string[]; + /** MultiClusterRoutingUseAny rowAffinity. */ + public rowAffinity?: (google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity|null); + + /** MultiClusterRoutingUseAny affinity. */ + public affinity?: "rowAffinity"; + /** * Creates a new MultiClusterRoutingUseAny instance using the specified properties. * @param [properties] Properties to set @@ -4410,6 +4432,100 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace MultiClusterRoutingUseAny { + + /** Properties of a RowAffinity. */ + interface IRowAffinity { + } + + /** Represents a RowAffinity. */ + class RowAffinity implements IRowAffinity { + + /** + * Constructs a new RowAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity); + + /** + * Creates a new RowAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns RowAffinity instance + */ + public static create(properties?: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity; + + /** + * Encodes the specified RowAffinity message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify|verify} messages. + * @param message RowAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowAffinity message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify|verify} messages. + * @param message RowAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity; + + /** + * Decodes a RowAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity; + + /** + * Verifies a RowAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowAffinity + */ + public static fromObject(object: { [k: string]: any }): google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity; + + /** + * Creates a plain object from a RowAffinity message. Also converts values to other types if specified. + * @param message RowAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowAffinity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a SingleClusterRouting. */ interface ISingleClusterRouting { @@ -25163,6 +25279,12 @@ export namespace google { /** FeatureFlags clientSideMetricsEnabled */ clientSideMetricsEnabled?: (boolean|null); + + /** FeatureFlags trafficDirectorEnabled */ + trafficDirectorEnabled?: (boolean|null); + + /** FeatureFlags directAccessRequested */ + directAccessRequested?: (boolean|null); } /** Represents a FeatureFlags. */ @@ -25195,6 +25317,12 @@ export namespace google { /** FeatureFlags clientSideMetricsEnabled. */ public clientSideMetricsEnabled: boolean; + /** FeatureFlags trafficDirectorEnabled. */ + public trafficDirectorEnabled: boolean; + + /** FeatureFlags directAccessRequested. */ + public directAccessRequested: boolean; + /** * Creates a new FeatureFlags instance using the specified properties. * @param [properties] Properties to set diff --git a/protos/protos.js b/protos/protos.js index bbbed66cb..74d23a9a2 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -8585,6 +8585,7 @@ * @property {string|null} [location] Cluster location * @property {google.bigtable.admin.v2.Cluster.State|null} [state] Cluster state * @property {number|null} [serveNodes] Cluster serveNodes + * @property {google.bigtable.admin.v2.Cluster.NodeScalingFactor|null} [nodeScalingFactor] Cluster nodeScalingFactor * @property {google.bigtable.admin.v2.Cluster.IClusterConfig|null} [clusterConfig] Cluster clusterConfig * @property {google.bigtable.admin.v2.StorageType|null} [defaultStorageType] Cluster defaultStorageType * @property {google.bigtable.admin.v2.Cluster.IEncryptionConfig|null} [encryptionConfig] Cluster encryptionConfig @@ -8637,6 +8638,14 @@ */ Cluster.prototype.serveNodes = 0; + /** + * Cluster nodeScalingFactor. + * @member {google.bigtable.admin.v2.Cluster.NodeScalingFactor} nodeScalingFactor + * @memberof google.bigtable.admin.v2.Cluster + * @instance + */ + Cluster.prototype.nodeScalingFactor = 0; + /** * Cluster clusterConfig. * @member {google.bigtable.admin.v2.Cluster.IClusterConfig|null|undefined} clusterConfig @@ -8713,6 +8722,8 @@ $root.google.bigtable.admin.v2.Cluster.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.clusterConfig != null && Object.hasOwnProperty.call(message, "clusterConfig")) $root.google.bigtable.admin.v2.Cluster.ClusterConfig.encode(message.clusterConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.nodeScalingFactor != null && Object.hasOwnProperty.call(message, "nodeScalingFactor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.nodeScalingFactor); return writer; }; @@ -8763,6 +8774,10 @@ message.serveNodes = reader.int32(); break; } + case 9: { + message.nodeScalingFactor = reader.int32(); + break; + } case 7: { message.clusterConfig = $root.google.bigtable.admin.v2.Cluster.ClusterConfig.decode(reader, reader.uint32()); break; @@ -8831,6 +8846,15 @@ if (message.serveNodes != null && message.hasOwnProperty("serveNodes")) if (!$util.isInteger(message.serveNodes)) return "serveNodes: integer expected"; + if (message.nodeScalingFactor != null && message.hasOwnProperty("nodeScalingFactor")) + switch (message.nodeScalingFactor) { + default: + return "nodeScalingFactor: enum value expected"; + case 0: + case 1: + case 2: + break; + } if (message.clusterConfig != null && message.hasOwnProperty("clusterConfig")) { properties.config = 1; { @@ -8902,6 +8926,26 @@ } if (object.serveNodes != null) message.serveNodes = object.serveNodes | 0; + switch (object.nodeScalingFactor) { + default: + if (typeof object.nodeScalingFactor === "number") { + message.nodeScalingFactor = object.nodeScalingFactor; + break; + } + break; + case "NODE_SCALING_FACTOR_UNSPECIFIED": + case 0: + message.nodeScalingFactor = 0; + break; + case "NODE_SCALING_FACTOR_1X": + case 1: + message.nodeScalingFactor = 1; + break; + case "NODE_SCALING_FACTOR_2X": + case 2: + message.nodeScalingFactor = 2; + break; + } if (object.clusterConfig != null) { if (typeof object.clusterConfig !== "object") throw TypeError(".google.bigtable.admin.v2.Cluster.clusterConfig: object expected"); @@ -8955,6 +8999,7 @@ object.serveNodes = 0; object.defaultStorageType = options.enums === String ? "STORAGE_TYPE_UNSPECIFIED" : 0; object.encryptionConfig = null; + object.nodeScalingFactor = options.enums === String ? "NODE_SCALING_FACTOR_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -8973,6 +9018,8 @@ if (options.oneofs) object.config = "clusterConfig"; } + if (message.nodeScalingFactor != null && message.hasOwnProperty("nodeScalingFactor")) + object.nodeScalingFactor = options.enums === String ? $root.google.bigtable.admin.v2.Cluster.NodeScalingFactor[message.nodeScalingFactor] === undefined ? message.nodeScalingFactor : $root.google.bigtable.admin.v2.Cluster.NodeScalingFactor[message.nodeScalingFactor] : message.nodeScalingFactor; return object; }; @@ -9022,6 +9069,22 @@ return values; })(); + /** + * NodeScalingFactor enum. + * @name google.bigtable.admin.v2.Cluster.NodeScalingFactor + * @enum {number} + * @property {number} NODE_SCALING_FACTOR_UNSPECIFIED=0 NODE_SCALING_FACTOR_UNSPECIFIED value + * @property {number} NODE_SCALING_FACTOR_1X=1 NODE_SCALING_FACTOR_1X value + * @property {number} NODE_SCALING_FACTOR_2X=2 NODE_SCALING_FACTOR_2X value + */ + Cluster.NodeScalingFactor = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NODE_SCALING_FACTOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "NODE_SCALING_FACTOR_1X"] = 1; + values[valuesById[2] = "NODE_SCALING_FACTOR_2X"] = 2; + return values; + })(); + Cluster.ClusterAutoscalingConfig = (function() { /** @@ -10147,6 +10210,7 @@ * @memberof google.bigtable.admin.v2.AppProfile * @interface IMultiClusterRoutingUseAny * @property {Array.|null} [clusterIds] MultiClusterRoutingUseAny clusterIds + * @property {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity|null} [rowAffinity] MultiClusterRoutingUseAny rowAffinity */ /** @@ -10173,6 +10237,28 @@ */ MultiClusterRoutingUseAny.prototype.clusterIds = $util.emptyArray; + /** + * MultiClusterRoutingUseAny rowAffinity. + * @member {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity|null|undefined} rowAffinity + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @instance + */ + MultiClusterRoutingUseAny.prototype.rowAffinity = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MultiClusterRoutingUseAny affinity. + * @member {"rowAffinity"|undefined} affinity + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @instance + */ + Object.defineProperty(MultiClusterRoutingUseAny.prototype, "affinity", { + get: $util.oneOfGetter($oneOfFields = ["rowAffinity"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new MultiClusterRoutingUseAny instance using the specified properties. * @function create @@ -10200,6 +10286,8 @@ if (message.clusterIds != null && message.clusterIds.length) for (var i = 0; i < message.clusterIds.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterIds[i]); + if (message.rowAffinity != null && Object.hasOwnProperty.call(message, "rowAffinity")) + $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.encode(message.rowAffinity, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -10240,6 +10328,10 @@ message.clusterIds.push(reader.string()); break; } + case 3: { + message.rowAffinity = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -10275,6 +10367,7 @@ MultiClusterRoutingUseAny.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.clusterIds != null && message.hasOwnProperty("clusterIds")) { if (!Array.isArray(message.clusterIds)) return "clusterIds: array expected"; @@ -10282,6 +10375,14 @@ if (!$util.isString(message.clusterIds[i])) return "clusterIds: string[] expected"; } + if (message.rowAffinity != null && message.hasOwnProperty("rowAffinity")) { + properties.affinity = 1; + { + var error = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify(message.rowAffinity); + if (error) + return "rowAffinity." + error; + } + } return null; }; @@ -10304,6 +10405,11 @@ for (var i = 0; i < object.clusterIds.length; ++i) message.clusterIds[i] = String(object.clusterIds[i]); } + if (object.rowAffinity != null) { + if (typeof object.rowAffinity !== "object") + throw TypeError(".google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.rowAffinity: object expected"); + message.rowAffinity = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.fromObject(object.rowAffinity); + } return message; }; @@ -10327,6 +10433,11 @@ for (var j = 0; j < message.clusterIds.length; ++j) object.clusterIds[j] = message.clusterIds[j]; } + if (message.rowAffinity != null && message.hasOwnProperty("rowAffinity")) { + object.rowAffinity = $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.toObject(message.rowAffinity, options); + if (options.oneofs) + object.affinity = "rowAffinity"; + } return object; }; @@ -10356,6 +10467,181 @@ return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny"; }; + MultiClusterRoutingUseAny.RowAffinity = (function() { + + /** + * Properties of a RowAffinity. + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @interface IRowAffinity + */ + + /** + * Constructs a new RowAffinity. + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + * @classdesc Represents a RowAffinity. + * @implements IRowAffinity + * @constructor + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity=} [properties] Properties to set + */ + function RowAffinity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RowAffinity instance using the specified properties. + * @function create + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity=} [properties] Properties to set + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} RowAffinity instance + */ + RowAffinity.create = function create(properties) { + return new RowAffinity(properties); + }; + + /** + * Encodes the specified RowAffinity message. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify|verify} messages. + * @function encode + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity} message RowAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RowAffinity message, length delimited. Does not implicitly {@link google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.IRowAffinity} message RowAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} RowAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowAffinity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} RowAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowAffinity message. + * @function verify + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RowAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} RowAffinity + */ + RowAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + return object; + return new $root.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity(); + }; + + /** + * Creates a plain object from a RowAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} message RowAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowAffinity.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RowAffinity to JSON. + * @function toJSON + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @instance + * @returns {Object.} JSON object + */ + RowAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowAffinity + * @function getTypeUrl + * @memberof google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity"; + }; + + return RowAffinity; + })(); + return MultiClusterRoutingUseAny; })(); @@ -59755,6 +60041,8 @@ * @property {boolean|null} [routingCookie] FeatureFlags routingCookie * @property {boolean|null} [retryInfo] FeatureFlags retryInfo * @property {boolean|null} [clientSideMetricsEnabled] FeatureFlags clientSideMetricsEnabled + * @property {boolean|null} [trafficDirectorEnabled] FeatureFlags trafficDirectorEnabled + * @property {boolean|null} [directAccessRequested] FeatureFlags directAccessRequested */ /** @@ -59828,6 +60116,22 @@ */ FeatureFlags.prototype.clientSideMetricsEnabled = false; + /** + * FeatureFlags trafficDirectorEnabled. + * @member {boolean} trafficDirectorEnabled + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.trafficDirectorEnabled = false; + + /** + * FeatureFlags directAccessRequested. + * @member {boolean} directAccessRequested + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.directAccessRequested = false; + /** * Creates a new FeatureFlags instance using the specified properties. * @function create @@ -59866,6 +60170,10 @@ writer.uint32(/* id 7, wireType 0 =*/56).bool(message.retryInfo); if (message.clientSideMetricsEnabled != null && Object.hasOwnProperty.call(message, "clientSideMetricsEnabled")) writer.uint32(/* id 8, wireType 0 =*/64).bool(message.clientSideMetricsEnabled); + if (message.trafficDirectorEnabled != null && Object.hasOwnProperty.call(message, "trafficDirectorEnabled")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.trafficDirectorEnabled); + if (message.directAccessRequested != null && Object.hasOwnProperty.call(message, "directAccessRequested")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.directAccessRequested); return writer; }; @@ -59928,6 +60236,14 @@ message.clientSideMetricsEnabled = reader.bool(); break; } + case 9: { + message.trafficDirectorEnabled = reader.bool(); + break; + } + case 10: { + message.directAccessRequested = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -59984,6 +60300,12 @@ if (message.clientSideMetricsEnabled != null && message.hasOwnProperty("clientSideMetricsEnabled")) if (typeof message.clientSideMetricsEnabled !== "boolean") return "clientSideMetricsEnabled: boolean expected"; + if (message.trafficDirectorEnabled != null && message.hasOwnProperty("trafficDirectorEnabled")) + if (typeof message.trafficDirectorEnabled !== "boolean") + return "trafficDirectorEnabled: boolean expected"; + if (message.directAccessRequested != null && message.hasOwnProperty("directAccessRequested")) + if (typeof message.directAccessRequested !== "boolean") + return "directAccessRequested: boolean expected"; return null; }; @@ -60013,6 +60335,10 @@ message.retryInfo = Boolean(object.retryInfo); if (object.clientSideMetricsEnabled != null) message.clientSideMetricsEnabled = Boolean(object.clientSideMetricsEnabled); + if (object.trafficDirectorEnabled != null) + message.trafficDirectorEnabled = Boolean(object.trafficDirectorEnabled); + if (object.directAccessRequested != null) + message.directAccessRequested = Boolean(object.directAccessRequested); return message; }; @@ -60037,6 +60363,8 @@ object.routingCookie = false; object.retryInfo = false; object.clientSideMetricsEnabled = false; + object.trafficDirectorEnabled = false; + object.directAccessRequested = false; } if (message.reverseScans != null && message.hasOwnProperty("reverseScans")) object.reverseScans = message.reverseScans; @@ -60052,6 +60380,10 @@ object.retryInfo = message.retryInfo; if (message.clientSideMetricsEnabled != null && message.hasOwnProperty("clientSideMetricsEnabled")) object.clientSideMetricsEnabled = message.clientSideMetricsEnabled; + if (message.trafficDirectorEnabled != null && message.hasOwnProperty("trafficDirectorEnabled")) + object.trafficDirectorEnabled = message.trafficDirectorEnabled; + if (message.directAccessRequested != null && message.hasOwnProperty("directAccessRequested")) + object.directAccessRequested = message.directAccessRequested; return object; }; diff --git a/protos/protos.json b/protos/protos.json index b086d3aa0..b6f0bbd29 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -1097,6 +1097,13 @@ "type": "int32", "id": 4 }, + "nodeScalingFactor": { + "type": "NodeScalingFactor", + "id": 9, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, "clusterConfig": { "type": "ClusterConfig", "id": 7 @@ -1126,6 +1133,13 @@ "DISABLED": 4 } }, + "NodeScalingFactor": { + "values": { + "NODE_SCALING_FACTOR_UNSPECIFIED": 0, + "NODE_SCALING_FACTOR_1X": 1, + "NODE_SCALING_FACTOR_2X": 2 + } + }, "ClusterAutoscalingConfig": { "fields": { "autoscalingLimits": { @@ -1224,11 +1238,27 @@ }, "nested": { "MultiClusterRoutingUseAny": { + "oneofs": { + "affinity": { + "oneof": [ + "rowAffinity" + ] + } + }, "fields": { "clusterIds": { "rule": "repeated", "type": "string", "id": 1 + }, + "rowAffinity": { + "type": "RowAffinity", + "id": 3 + } + }, + "nested": { + "RowAffinity": { + "fields": {} } } }, @@ -5919,6 +5949,14 @@ "clientSideMetricsEnabled": { "type": "bool", "id": 8 + }, + "trafficDirectorEnabled": { + "type": "bool", + "id": 9 + }, + "directAccessRequested": { + "type": "bool", + "id": 10 } } }, diff --git a/samples/generated/v2/bigtable_instance_admin.update_cluster.js b/samples/generated/v2/bigtable_instance_admin.update_cluster.js index abb3389e4..ee0341f15 100644 --- a/samples/generated/v2/bigtable_instance_admin.update_cluster.js +++ b/samples/generated/v2/bigtable_instance_admin.update_cluster.js @@ -20,7 +20,7 @@ 'use strict'; -function main(location, state, defaultStorageType, encryptionConfig) { +function main(location, state, nodeScalingFactor, defaultStorageType, encryptionConfig) { // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async] /** * This snippet has been automatically generated and should be regarded as a code template only. @@ -49,6 +49,10 @@ function main(location, state, defaultStorageType, encryptionConfig) { * throughput and more consistent performance. */ // const serveNodes = 1234 + /** + * Immutable. The node scaling factor of this cluster. + */ + // const nodeScalingFactor = {} /** * Configuration for this cluster. */ @@ -74,6 +78,7 @@ function main(location, state, defaultStorageType, encryptionConfig) { const request = { location, state, + nodeScalingFactor, defaultStorageType, encryptionConfig, }; diff --git a/samples/generated/v2/snippet_metadata_google.bigtable.admin.v2.json b/samples/generated/v2/snippet_metadata_google.bigtable.admin.v2.json index fbcdccc1e..27ea6f765 100644 --- a/samples/generated/v2/snippet_metadata_google.bigtable.admin.v2.json +++ b/samples/generated/v2/snippet_metadata_google.bigtable.admin.v2.json @@ -438,7 +438,7 @@ "segments": [ { "start": 25, - "end": 87, + "end": 92, "type": "FULL" } ], @@ -463,6 +463,10 @@ "name": "serve_nodes", "type": "TYPE_INT32" }, + { + "name": "node_scaling_factor", + "type": ".google.bigtable.admin.v2.Cluster.NodeScalingFactor" + }, { "name": "cluster_config", "type": ".google.bigtable.admin.v2.Cluster.ClusterConfig" diff --git a/src/v2/bigtable_instance_admin_client.ts b/src/v2/bigtable_instance_admin_client.ts index f8b5482e4..a32a84e67 100644 --- a/src/v2/bigtable_instance_admin_client.ts +++ b/src/v2/bigtable_instance_admin_client.ts @@ -2195,6 +2195,8 @@ export class BigtableInstanceAdminClient { * @param {number} request.serveNodes * The number of nodes allocated to this cluster. More nodes enable higher * throughput and more consistent performance. + * @param {google.bigtable.admin.v2.Cluster.NodeScalingFactor} request.nodeScalingFactor + * Immutable. The node scaling factor of this cluster. * @param {google.bigtable.admin.v2.Cluster.ClusterConfig} request.clusterConfig * Configuration for this cluster. * @param {google.bigtable.admin.v2.StorageType} request.defaultStorageType