Skip to content

Commit d6d1d22

Browse files
1 parent 2cba272 commit d6d1d22

7 files changed

Lines changed: 18 additions & 364 deletions

File tree

‎handwritten/spanner/google-cloud-spanner-executor/src/cloud-client-executor.ts‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@ export class ExecutionFlowContext implements ExecutionFlowContextInterface {
4949
* Sends a response back to the client.
5050
*/
5151
public onNext(response: SpannerAsyncActionResponse): void {
52-
5352
// Prevent writing if client cancelled the call, or the underlying Node stream is un-writable/destroyed
54-
if (this.call.cancelled || this.call.destroyed || this.call.writable === false) {
53+
if (
54+
this.call.cancelled ||
55+
this.call.destroyed ||
56+
this.call.writable === false
57+
) {
5558
console.warn('Attempted to write to a closed or cancelled stream.');
5659
return;
5760
}
@@ -92,7 +95,10 @@ export class CloudClientExecutor {
9295

9396
private readonly adminActionRegistry: Record<string, ActionHandler> = {
9497
createCloudInstance: (action, sender) =>
95-
this.executeCreateCloudInstance(action as ICreateCloudInstanceAction, sender),
98+
this.executeCreateCloudInstance(
99+
action as ICreateCloudInstanceAction,
100+
sender,
101+
),
96102
};
97103

98104
private readonly actionRegistry: Record<string, ActionHandler> = {
@@ -158,7 +164,10 @@ export class CloudClientExecutor {
158164
try {
159165
const handler = this.actionRegistry[actionType];
160166
if (handler) {
161-
await handler(action[actionType as keyof typeof action], outcomeSender);
167+
await handler(
168+
action[actionType as keyof typeof action],
169+
outcomeSender,
170+
);
162171
return;
163172
}
164173

‎handwritten/spanner/google-cloud-spanner-executor/src/cloud-executor-impl.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { ServerDuplexStream, status } from '@grpc/grpc-js';
17+
import {ServerDuplexStream, status} from '@grpc/grpc-js';
1818
import {trace, context, Tracer} from '@opentelemetry/api';
1919
import {CloudClientExecutor} from './cloud-client-executor';
2020
import * as protos from '../../protos/protos';

‎handwritten/spanner/google-cloud-spanner-executor/src/cloud-util.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import * as fs from 'fs';
1818
import * as grpc from '@grpc/grpc-js';
1919
import {WorkerProxy} from './worker-proxy';
20-
import { SpannerOptions } from '../../src';
20+
import {SpannerOptions} from '../../src';
2121

2222
/**
2323
* Provides utility methods for configuring the Cloud Spanner client for tests.
@@ -59,7 +59,8 @@ export class CloudUtil {
5959
// - default_authority is used for the HTTP/2 :authority header.
6060
(grpcOptions as grpc.ChannelOptions)['grpc.ssl_target_name_override'] =
6161
this.TEST_HOST_IN_CERT;
62-
(grpcOptions as grpc.ChannelOptions)['grpc.default_authority'] = this.TEST_HOST_IN_CERT;
62+
(grpcOptions as grpc.ChannelOptions)['grpc.default_authority'] =
63+
this.TEST_HOST_IN_CERT;
6364
}
6465

6566
(options as any).grpcOptions = grpcOptions;

‎handwritten/spanner/google-cloud-spanner-executor/src/worker-proxy.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ const OPTION_SERVICE_KEY_FILE = 'service_key_file';
4343
const OPTION_USE_PLAIN_TEXT_CHANNEL = 'use_plain_text_channel';
4444
const OPTION_ENABLE_GRPC_FAULT_INJECTOR = 'enable_grpc_fault_injector';
4545

46-
4746
/**
4847
* Acts as a proxy server that forwards incoming gRPC requests to the underlying
4948
* Spanner CloudExecutor implementation.
@@ -126,7 +125,6 @@ export class WorkerProxy {
126125
description: 'Enable grpc fault injector in cloud client executor.',
127126
});
128127

129-
130128
try {
131129
return parser.parseSync();
132130
} catch (e: any) {

‎handwritten/spanner/protos/protos.d.ts‎

Lines changed: 0 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)