From 0b6bcee9b4f26bbc5e610b55283b73a25e2d0c1b Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 1 Aug 2025 09:55:56 -0400 Subject: [PATCH 1/2] mutateRow final cosmetic changes --- src/utils/mutateInternal.ts | 12 ++++++++++++ system-test/client-side-metrics-all-methods.ts | 10 +++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/utils/mutateInternal.ts b/src/utils/mutateInternal.ts index f068543cf..164db7a78 100644 --- a/src/utils/mutateInternal.ts +++ b/src/utils/mutateInternal.ts @@ -32,6 +32,18 @@ import * as is from 'is'; import {Mutation} from '../mutation'; import arrify = require('arrify'); +/** + * Applies a set of changes to be atomically applied to the specified row(s). + * Mutations are applied in order, meaning that earlier mutations can be masked + * by later ones. This internal function handles the retry logic and metrics collection + * for the mutate operation. + * + * @param {TabularApiSurface} table The table or authorized view to perform the mutation on. + * @param {OperationMetricsCollector} metricsCollector The metrics collector for the operation. + * @param {Entry | Entry[]} entriesRaw List of entities to be inserted or deleted. + * @param {MutateOptions | MutateCallback} [optionsOrCallback] Configuration object or callback function. + * @param {MutateCallback} [cb] The callback function. + */ export function mutateInternal( table: TabularApiSurface, metricsCollector: OperationMetricsCollector, diff --git a/system-test/client-side-metrics-all-methods.ts b/system-test/client-side-metrics-all-methods.ts index 8b64746a1..4c14f05c6 100644 --- a/system-test/client-side-metrics-all-methods.ts +++ b/system-test/client-side-metrics-all-methods.ts @@ -66,7 +66,7 @@ function getHandlerFromExporter(Exporter: typeof CloudMonitoringExporter) { }).GCPMetricsHandler; } -function readRowsAssertionCheck( +function metricsAssertionCheck( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], method: string, @@ -171,7 +171,7 @@ function checkMultiRowCall( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], ) { - readRowsAssertionCheck( + metricsAssertionCheck( projectId, requestsHandled, 'Bigtable.ReadRows', @@ -183,7 +183,7 @@ function checkMutateRowsCall( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], ) { - readRowsAssertionCheck( + metricsAssertionCheck( projectId, requestsHandled, 'Bigtable.MutateRows', @@ -195,7 +195,7 @@ function checkMutateRowCall( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], ) { - readRowsAssertionCheck( + metricsAssertionCheck( projectId, requestsHandled, 'Bigtable.MutateRow', @@ -207,7 +207,7 @@ function checkSingleRowCall( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], ) { - readRowsAssertionCheck( + metricsAssertionCheck( projectId, requestsHandled, 'Bigtable.ReadRow', From 96b4fabfc225174916bb7093160ba3070b27d436 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 1 Aug 2025 09:55:56 -0400 Subject: [PATCH 2/2] feat: For mutateRow, address final cosmetic changes --- src/utils/mutateInternal.ts | 12 ++++++++++++ system-test/client-side-metrics-all-methods.ts | 10 +++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/utils/mutateInternal.ts b/src/utils/mutateInternal.ts index f068543cf..164db7a78 100644 --- a/src/utils/mutateInternal.ts +++ b/src/utils/mutateInternal.ts @@ -32,6 +32,18 @@ import * as is from 'is'; import {Mutation} from '../mutation'; import arrify = require('arrify'); +/** + * Applies a set of changes to be atomically applied to the specified row(s). + * Mutations are applied in order, meaning that earlier mutations can be masked + * by later ones. This internal function handles the retry logic and metrics collection + * for the mutate operation. + * + * @param {TabularApiSurface} table The table or authorized view to perform the mutation on. + * @param {OperationMetricsCollector} metricsCollector The metrics collector for the operation. + * @param {Entry | Entry[]} entriesRaw List of entities to be inserted or deleted. + * @param {MutateOptions | MutateCallback} [optionsOrCallback] Configuration object or callback function. + * @param {MutateCallback} [cb] The callback function. + */ export function mutateInternal( table: TabularApiSurface, metricsCollector: OperationMetricsCollector, diff --git a/system-test/client-side-metrics-all-methods.ts b/system-test/client-side-metrics-all-methods.ts index 8b64746a1..4c14f05c6 100644 --- a/system-test/client-side-metrics-all-methods.ts +++ b/system-test/client-side-metrics-all-methods.ts @@ -66,7 +66,7 @@ function getHandlerFromExporter(Exporter: typeof CloudMonitoringExporter) { }).GCPMetricsHandler; } -function readRowsAssertionCheck( +function metricsAssertionCheck( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], method: string, @@ -171,7 +171,7 @@ function checkMultiRowCall( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], ) { - readRowsAssertionCheck( + metricsAssertionCheck( projectId, requestsHandled, 'Bigtable.ReadRows', @@ -183,7 +183,7 @@ function checkMutateRowsCall( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], ) { - readRowsAssertionCheck( + metricsAssertionCheck( projectId, requestsHandled, 'Bigtable.MutateRows', @@ -195,7 +195,7 @@ function checkMutateRowCall( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], ) { - readRowsAssertionCheck( + metricsAssertionCheck( projectId, requestsHandled, 'Bigtable.MutateRow', @@ -207,7 +207,7 @@ function checkSingleRowCall( projectId: string, requestsHandled: (OnOperationCompleteData | OnAttemptCompleteData)[] = [], ) { - readRowsAssertionCheck( + metricsAssertionCheck( projectId, requestsHandled, 'Bigtable.ReadRow',