diff --git a/spanner/client.go b/spanner/client.go index 1a52fa5abfd..df10dfc587b 100644 --- a/spanner/client.go +++ b/spanner/client.go @@ -178,6 +178,7 @@ func NewClientWithConfig(ctx context.Context, database string, config ClientConf ), option.WithGRPCConnectionPool(config.NumChannels), option.WithUserAgent(clientUserAgent), + internaloption.EnableDirectPath(true), } // opts will take precedence above allOpts, as the values in opts will be // applied after the values in allOpts. diff --git a/spanner/integration_test.go b/spanner/integration_test.go index 6c3a0738095..3f87716f47c 100644 --- a/spanner/integration_test.go +++ b/spanner/integration_test.go @@ -40,7 +40,6 @@ import ( instance "cloud.google.com/go/spanner/admin/instance/apiv1" "google.golang.org/api/iterator" "google.golang.org/api/option" - "google.golang.org/api/option/internaloption" adminpb "google.golang.org/genproto/googleapis/spanner/admin/database/v1" instancepb "google.golang.org/genproto/googleapis/spanner/admin/instance/v1" sppb "google.golang.org/genproto/googleapis/spanner/v1" @@ -239,8 +238,6 @@ func initIntegrationTests() (cleanup func()) { opts = append(opts, option.WithEndpoint(spannerHost)) } if dpConfig.attemptDirectPath { - // TODO(mohanli): Move EnableDirectPath internal option to client.go when DirectPath is ready for public beta. - opts = append(opts, internaloption.EnableDirectPath(true)) opts = append(opts, option.WithGRPCDialOption(grpc.WithDefaultCallOptions(grpc.Peer(peerInfo)))) } var err error @@ -3211,8 +3208,6 @@ func createClient(ctx context.Context, dbPath string, spc SessionPoolConfig) (cl opts = append(opts, option.WithEndpoint(spannerHost)) } if dpConfig.attemptDirectPath { - // TODO(mohanli): Move EnableDirectPath internal option to client.go when DirectPath is ready for public beta. - opts = append(opts, internaloption.EnableDirectPath(true)) opts = append(opts, option.WithGRPCDialOption(grpc.WithDefaultCallOptions(grpc.Peer(peerInfo)))) } client, err = NewClientWithConfig(ctx, dbPath, ClientConfig{SessionPoolConfig: spc}, opts...)