diff --git a/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_client_config.json b/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_client_config.json index 47e1b111a246..49e2a60357bc 100644 --- a/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_client_config.json +++ b/Bigtable/src/Admin/V2/resources/bigtable_instance_admin_client_config.json @@ -2,178 +2,207 @@ "interfaces": { "google.bigtable.admin.v2.BigtableInstanceAdmin": { "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" + "no_retry_codes": [], + "no_retry_4_codes": [], + "retry_policy_3_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" ], - "non_idempotent": [] + "no_retry_5_codes": [] }, "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_4_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 300000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 300000, + "total_timeout_millis": 300000 + }, + "retry_policy_3_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2.0, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 60000, "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_5_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 } }, "methods": { "CreateAppProfile": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_5_codes", + "retry_params_name": "no_retry_5_params" }, "CreateCluster": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_5_codes", + "retry_params_name": "no_retry_5_params" }, "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 300000, + "retry_codes_name": "no_retry_4_codes", + "retry_params_name": "no_retry_4_params" }, "CreateLogicalView": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "CreateMaterializedView": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "DeleteAppProfile": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_5_codes", + "retry_params_name": "no_retry_5_params" }, "DeleteCluster": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_5_codes", + "retry_params_name": "no_retry_5_params" }, "DeleteInstance": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_5_codes", + "retry_params_name": "no_retry_5_params" }, "DeleteLogicalView": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "DeleteMaterializedView": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "GetAppProfile": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "GetCluster": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "GetIamPolicy": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "GetInstance": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "GetLogicalView": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "GetMaterializedView": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "ListAppProfiles": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "ListClusters": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "ListHotTablets": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "ListInstances": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "ListLogicalViews": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "ListMaterializedViews": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "PartialUpdateCluster": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "PartialUpdateInstance": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "SetIamPolicy": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_5_codes", + "retry_params_name": "no_retry_5_params" }, "TestIamPermissions": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "UpdateAppProfile": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "UpdateCluster": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "UpdateInstance": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_3_codes", + "retry_params_name": "retry_policy_3_params" }, "UpdateLogicalView": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "UpdateMaterializedView": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" } } } diff --git a/Bigtable/src/Admin/V2/resources/bigtable_table_admin_client_config.json b/Bigtable/src/Admin/V2/resources/bigtable_table_admin_client_config.json index e92f3cdcbf41..c12d4bb2846a 100644 --- a/Bigtable/src/Admin/V2/resources/bigtable_table_admin_client_config.json +++ b/Bigtable/src/Admin/V2/resources/bigtable_table_admin_client_config.json @@ -2,198 +2,250 @@ "interfaces": { "google.bigtable.admin.v2.BigtableTableAdmin": { "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" + "no_retry_codes": [], + "no_retry_1_codes": [], + "no_retry_2_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" ], - "non_idempotent": [] + "retry_policy_2_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ], + "no_retry_3_codes": [] }, "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 300000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 300000, + "total_timeout_millis": 300000 + }, + "no_retry_2_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2.0, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 2.0, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, + "initial_rpc_timeout_millis": 3600000, "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 + "max_rpc_timeout_millis": 3600000, + "total_timeout_millis": 3600000 + }, + "no_retry_3_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 3600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 3600000, + "total_timeout_millis": 3600000 } }, "methods": { "CheckConsistency": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 3600000, + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" }, "CopyBackup": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "CreateAuthorizedView": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "CreateBackup": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_2_codes", + "retry_params_name": "no_retry_2_params" }, "CreateSchemaBundle": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "CreateTable": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" }, "CreateTableFromSnapshot": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "DeleteAuthorizedView": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "DeleteBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" }, "DeleteSchemaBundle": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "DeleteSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" }, "DeleteTable": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" }, "DropRowRange": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 3600000, + "retry_codes_name": "no_retry_3_codes", + "retry_params_name": "no_retry_3_params" }, "GenerateConsistencyToken": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "GetAuthorizedView": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "GetBackup": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "GetIamPolicy": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "GetSchemaBundle": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "GetSnapshot": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "GetTable": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "ListAuthorizedViews": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "ListBackups": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "ListSchemaBundles": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "ListSnapshots": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "ListTables": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "ModifyColumnFamilies": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 300000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" }, "RestoreTable": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_2_codes", + "retry_params_name": "no_retry_2_params" }, "SetIamPolicy": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_2_codes", + "retry_params_name": "no_retry_2_params" }, "SnapshotTable": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "TestIamPermissions": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" }, "UndeleteTable": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "UpdateAuthorizedView": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "UpdateBackup": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_2_codes", + "retry_params_name": "no_retry_2_params" }, "UpdateSchemaBundle": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "UpdateTable": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" } } } diff --git a/Bigtable/src/BigtableClient.php b/Bigtable/src/BigtableClient.php index 62fa1d032257..309b1c083633 100644 --- a/Bigtable/src/BigtableClient.php +++ b/Bigtable/src/BigtableClient.php @@ -144,6 +144,10 @@ class BigtableClient */ public function __construct(array $config = []) { + $config += [ + 'clientConfig' => __DIR__ . '/resources/bigtable_client_config.json', + ]; + if (!isset($config['transportConfig']['grpc']['stubOpts'])) { $config['transportConfig']['grpc']['stubOpts'] = []; } @@ -196,7 +200,7 @@ public function table($instanceId, $tableId, array $options = []) { if ($this->pingAndWarm && !($this->pingAndWarmCalled[$instanceId] ?? false)) { // The default deadline is configured by the "clientConfig" option, which uses - // `src/V2/resources/bigtable_client_config.json`. + // `src/resources/bigtable_client_config.json`. // This default deadline should be high enough to absorb cold connection latencies. list($data, $callOptions) = $this->splitOptionalArgs($options); $data['name'] = GapicClient::instanceName($this->projectId, $instanceId); diff --git a/Bigtable/src/V2/resources/bigtable_client_config.json b/Bigtable/src/V2/resources/bigtable_client_config.json index ced272b5d1f4..398c3238d1aa 100644 --- a/Bigtable/src/V2/resources/bigtable_client_config.json +++ b/Bigtable/src/V2/resources/bigtable_client_config.json @@ -2,47 +2,129 @@ "interfaces": { "google.bigtable.v2.Bigtable": { "retry_codes": { - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" + "no_retry_codes": [], + "no_retry_1_codes": [], + "no_retry_2_codes": [], + "no_retry_3_codes": [], + "no_retry_4_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" ], - "non_idempotent": [] + "retry_policy_2_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ], + "no_retry_5_codes": [], + "no_retry_6_codes": [] }, "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, "initial_rpc_timeout_millis": 20000, "rpc_timeout_multiplier": 1.0, "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 20000 + }, + "no_retry_2_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_3_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 600000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 600000, "total_timeout_millis": 600000 + }, + "no_retry_4_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 43200000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 43200000, + "total_timeout_millis": 43200000 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 10, + "retry_delay_multiplier": 2.0, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 43200000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 43200000, + "total_timeout_millis": 43200000 + }, + "retry_policy_2_params": { + "initial_retry_delay_millis": 10, + "retry_delay_multiplier": 2.0, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_5_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_6_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 43200000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 43200000, + "total_timeout_millis": 43200000 } }, "methods": { "CheckAndMutateRow": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" }, "ExecuteQuery": { - "timeout_millis": 60000 + "timeout_millis": 43200000 }, "GenerateInitialChangeStreamPartitions": { "timeout_millis": 60000 }, "GetClientConfiguration": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "MutateRow": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "retry_policy_2_codes", + "retry_params_name": "retry_policy_2_params" }, "MutateRows": { - "timeout_millis": 60000 + "timeout_millis": 600000 }, "OpenAuthorizedView": { "timeout_millis": 60000 @@ -55,24 +137,24 @@ }, "PingAndWarm": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "PrepareQuery": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" }, "ReadChangeStream": { - "timeout_millis": 60000 + "timeout_millis": 43200000 }, "ReadModifyWriteRow": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 20000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" }, "ReadRows": { - "timeout_millis": 60000 + "timeout_millis": 43200000 }, "SampleRowKeys": { "timeout_millis": 60000 diff --git a/Bigtable/src/resources/bigtable_client_config.json b/Bigtable/src/resources/bigtable_client_config.json new file mode 100644 index 000000000000..ced272b5d1f4 --- /dev/null +++ b/Bigtable/src/resources/bigtable_client_config.json @@ -0,0 +1,83 @@ +{ + "interfaces": { + "google.bigtable.v2.Bigtable": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CheckAndMutateRow": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExecuteQuery": { + "timeout_millis": 60000 + }, + "GenerateInitialChangeStreamPartitions": { + "timeout_millis": 60000 + }, + "GetClientConfiguration": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MutateRow": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MutateRows": { + "timeout_millis": 60000 + }, + "OpenAuthorizedView": { + "timeout_millis": 60000 + }, + "OpenMaterializedView": { + "timeout_millis": 60000 + }, + "OpenTable": { + "timeout_millis": 60000 + }, + "PingAndWarm": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PrepareQuery": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadChangeStream": { + "timeout_millis": 60000 + }, + "ReadModifyWriteRow": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadRows": { + "timeout_millis": 60000 + }, + "SampleRowKeys": { + "timeout_millis": 60000 + } + } + } + } +} diff --git a/Bigtable/tests/Unit/BigtableClientTest.php b/Bigtable/tests/Unit/BigtableClientTest.php index 9adf5e55b77a..aa0c449bab29 100644 --- a/Bigtable/tests/Unit/BigtableClientTest.php +++ b/Bigtable/tests/Unit/BigtableClientTest.php @@ -108,4 +108,46 @@ public function testPingAndWarm() $bigtable->table('my-instance', 'my-table-2'); // still not called $bigtable->table('my-instance-2', 'my-table'); // called } + + public function testDefaultClientConfig() + { + $bigtable = new BigtableClient([ + 'projectId' => 'my-project', + 'credentials' => new InsecureCredentialsWrapper(), + ]); + + $gapicClient = (fn() => $this->gapicClient)->call($bigtable); + $retrySettings = (fn() => $this->retrySettings)->call($gapicClient); + + $this->assertEquals(60000, $retrySettings['CheckAndMutateRow']->getNoRetriesRpcTimeoutMillis()); + $this->assertEquals(60000, $retrySettings['ExecuteQuery']->getNoRetriesRpcTimeoutMillis()); + } + + public function testCustomClientConfig() + { + $customConfig = [ + 'interfaces' => [ + 'google.bigtable.v2.Bigtable' => [ + 'retry_codes' => [], + 'retry_params' => [], + 'methods' => [ + 'CheckAndMutateRow' => [ + 'timeout_millis' => 12345, + ], + ], + ], + ], + ]; + + $bigtable = new BigtableClient([ + 'projectId' => 'my-project', + 'credentials' => new InsecureCredentialsWrapper(), + 'clientConfig' => $customConfig, + ]); + + $gapicClient = (fn() => $this->gapicClient)->call($bigtable); + $retrySettings = (fn() => $this->retrySettings)->call($gapicClient); + + $this->assertEquals(12345, $retrySettings['CheckAndMutateRow']->getNoRetriesRpcTimeoutMillis()); + } } diff --git a/librarian.yaml b/librarian.yaml index c92495b9b915..138a3ce89b9e 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -496,12 +496,9 @@ libraries: version: 2.27.1 apis: - path: google/bigtable/v2 - php: - skip_grpc_service_config: true - path: google/bigtable/admin/v2 php: gapic_yaml: google/bigtable/admin/v2/bigtableadmin_gapic.yaml - skip_grpc_service_config: true staging_subdir: Admin/v2 copyright_year: "2026" keep: