From 29e91278a8007b5e3e1ff9d50bcaee792e44829b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 14:42:09 -0600 Subject: [PATCH] feat: Add support for Cloud Bigtable Row Affinity in App Profiles (#7665) PiperOrigin-RevId: 673093969 Source-Link: https://github.com/googleapis/googleapis/commit/cbf696d38a963c5ab333f85fc9a910b5698ad415 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a2f7ec1191813304b3bd0097caa33956bdb3b637 Copy-Tag: eyJwIjoiQmlndGFibGUvLk93bEJvdC55YW1sIiwiaCI6ImEyZjdlYzExOTE4MTMzMDRiM2JkMDA5N2NhYTMzOTU2YmRiM2I2MzcifQ== --- Bigtable/metadata/Admin/V2/Instance.php | Bin 4678 -> 4806 bytes .../AppProfile/MultiClusterRoutingUseAny.php | 45 ++++++++++++++++++ .../MultiClusterRoutingUseAny/RowAffinity.php | 44 +++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 Bigtable/src/Admin/V2/AppProfile/MultiClusterRoutingUseAny/RowAffinity.php diff --git a/Bigtable/metadata/Admin/V2/Instance.php b/Bigtable/metadata/Admin/V2/Instance.php index 22005ad358e9cd0265a1f52cd7d3f003dd9ce7ed..51e9f0c248b6ccff2f1ccb55a01996628932bc1c 100644 GIT binary patch delta 108 zcmX@6a!hr@X(mSb&1aaZ*%`SudvNhEF|B8u9Li%LA(X_$Q)EdvNhEF&az`<1yIG%6pI%0J0wma{vGU diff --git a/Bigtable/src/Admin/V2/AppProfile/MultiClusterRoutingUseAny.php b/Bigtable/src/Admin/V2/AppProfile/MultiClusterRoutingUseAny.php index a0b957de149a..455a007dbf2b 100644 --- a/Bigtable/src/Admin/V2/AppProfile/MultiClusterRoutingUseAny.php +++ b/Bigtable/src/Admin/V2/AppProfile/MultiClusterRoutingUseAny.php @@ -26,6 +26,7 @@ class MultiClusterRoutingUseAny extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated string cluster_ids = 1; */ private $cluster_ids; + protected $affinity; /** * Constructor. @@ -36,6 +37,9 @@ class MultiClusterRoutingUseAny extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\RepeatedField $cluster_ids * 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. + * @type \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny\RowAffinity $row_affinity + * Row affinity sticky routing based on the row key of the request. + * Requests that span multiple rows are routed non-deterministically. * } */ public function __construct($data = NULL) { @@ -71,6 +75,47 @@ public function setClusterIds($var) return $this; } + /** + * Row affinity sticky routing based on the row key of the request. + * Requests that span multiple rows are routed non-deterministically. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * @return \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny\RowAffinity|null + */ + public function getRowAffinity() + { + return $this->readOneof(3); + } + + public function hasRowAffinity() + { + return $this->hasOneof(3); + } + + /** + * Row affinity sticky routing based on the row key of the request. + * Requests that span multiple rows are routed non-deterministically. + * + * Generated from protobuf field .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * @param \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny\RowAffinity $var + * @return $this + */ + public function setRowAffinity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\AppProfile\MultiClusterRoutingUseAny\RowAffinity::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getAffinity() + { + return $this->whichOneof("affinity"); + } + } // Adding a class alias for backwards compatibility with the previous class name. diff --git a/Bigtable/src/Admin/V2/AppProfile/MultiClusterRoutingUseAny/RowAffinity.php b/Bigtable/src/Admin/V2/AppProfile/MultiClusterRoutingUseAny/RowAffinity.php new file mode 100644 index 000000000000..f553b0a42fad --- /dev/null +++ b/Bigtable/src/Admin/V2/AppProfile/MultiClusterRoutingUseAny/RowAffinity.php @@ -0,0 +1,44 @@ +google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + */ +class RowAffinity extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce(); + parent::__construct($data); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RowAffinity::class, \Google\Cloud\Bigtable\Admin\V2\AppProfile_MultiClusterRoutingUseAny_RowAffinity::class); +