Skip to content

Commit d0f2bce

Browse files
committed
review comments
1 parent 40e715f commit d0f2bce

3 files changed

Lines changed: 4 additions & 24 deletions

File tree

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ export class CloudClientExecutor {
213213
});
214214

215215
console.log('Waiting for instance creation operation to complete...');
216-
217216
await operation.promise();
218217

219218
console.log(`Instance ${instanceId} created successfully.`);

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

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

17-
import {ServerDuplexStream, status, ServiceError} 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';
@@ -64,22 +64,7 @@ export class CloudExecutorImpl {
6464
call.on('data', (request: SpannerAsyncActionRequest) => {
6565
context.with(streamContext, () => {
6666
console.log(`Receiving request: \n${JSON.stringify(request, null, 2)}`);
67-
68-
// Ensure nested properties exist before attempting to inject configuration overrides.
69-
if (!request.action) request.action = {};
70-
if (!request.action.spannerOptions) request.action.spannerOptions = {};
71-
if (!request.action.spannerOptions.sessionPoolOptions)
72-
request.action.spannerOptions.sessionPoolOptions = {};
73-
74-
// as the multiplexed session is defualt enabled, mutate the incoming request to forcefully enforce multiplexed sessions for this proxy execution.
75-
request.action.spannerOptions.sessionPoolOptions.useMultiplexed = true;
76-
77-
console.log(
78-
`Updated request to set multiplexed session flag: \n${JSON.stringify(request, null, 2)}`,
79-
);
80-
8167
// TODO: Set requestHasReadOrQueryAction flag here when Read/Query are implemented.
82-
8368
try {
8469
const reqStatus = this.clientExecutor.startHandlingRequest(
8570
request,

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ const OPTION_CERTIFICATE = 'cert';
4242
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';
45-
const OPTION_MULTIPLEXED_SESSION_OPERATIONS_RATIO =
46-
'multiplexed_session_operations_ratio';
45+
4746

4847
/**
4948
* Acts as a proxy server that forwards incoming gRPC requests to the underlying
@@ -54,7 +53,7 @@ export class WorkerProxy {
5453
public static proxyPort = 0;
5554
public static cert = '';
5655
public static serviceKeyFile = '';
57-
public static multiplexedSessionOperationsRatio = 0.0;
56+
5857
public static usePlainTextChannel = false;
5958
public static enableGrpcFaultInjector = false;
6059
public static openTelemetrySdk: NodeTracerProvider;
@@ -126,10 +125,7 @@ export class WorkerProxy {
126125
type: 'boolean',
127126
description: 'Enable grpc fault injector in cloud client executor.',
128127
});
129-
parser.option(OPTION_MULTIPLEXED_SESSION_OPERATIONS_RATIO, {
130-
type: 'number',
131-
description: 'Ratio of operations to use multiplexed sessions.',
132-
});
128+
133129

134130
try {
135131
return parser.parseSync();

0 commit comments

Comments
 (0)