From 2b5a2b55eb996a65c1483bc81f77406b60e91752 Mon Sep 17 00:00:00 2001 From: Cody Oss <6331106+codyoss@users.noreply.github.com> Date: Fri, 29 Sep 2023 10:24:14 -0500 Subject: [PATCH] chore(bigtable): switch to google.golang.org/protobuf (#8626) Revival of #4317 without conflicts. --- bigtable/admin.go | 47 +-- bigtable/bigtable.go | 2 +- bigtable/bttest/inmem.go | 8 +- bigtable/bttest/inmem_test.go | 60 +-- bigtable/bttest/instance_server.go | 10 +- bigtable/conformance_test.go | 5 +- bigtable/gc.go | 4 +- bigtable/go.mod | 2 +- bigtable/integration_test.go | 2 +- bigtable/internal/conformance/README.md | 2 +- bigtable/internal/conformance/tests.pb.go | 469 ++++++++++++++-------- bigtable/internal/conformance/tests.proto | 5 +- bigtable/internal/testproxy/proxy.go | 8 +- bigtable/reader_test.go | 14 +- bigtable/retry_test.go | 6 +- 15 files changed, 393 insertions(+), 251 deletions(-) diff --git a/bigtable/admin.go b/bigtable/admin.go index d62dea9288d1..fe20259595fe 100644 --- a/bigtable/admin.go +++ b/bigtable/admin.go @@ -31,8 +31,6 @@ import ( "cloud.google.com/go/internal/optional" "cloud.google.com/go/longrunning" lroauto "cloud.google.com/go/longrunning/autogen" - "github.com/golang/protobuf/ptypes" - durpb "github.com/golang/protobuf/ptypes/duration" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/cloudresourcemanager/v1" "google.golang.org/api/iterator" @@ -43,6 +41,7 @@ import ( "google.golang.org/grpc/metadata" "google.golang.org/protobuf/types/known/durationpb" field_mask "google.golang.org/protobuf/types/known/fieldmaskpb" + "google.golang.org/protobuf/types/known/timestamppb" ) const adminAddr = "bigtableadmin.googleapis.com:443" @@ -565,10 +564,10 @@ func (ac *AdminClient) SnapshotTable(ctx context.Context, table, cluster, snapsh ctx = mergeOutgoingMetadata(ctx, ac.md) prefix := ac.instancePrefix() - var ttlProto *durpb.Duration + var ttlProto *durationpb.Duration if ttl > 0 { - ttlProto = ptypes.DurationProto(ttl) + ttlProto = durationpb.New(ttl) } req := &btapb.SnapshotTableRequest{ @@ -643,15 +642,15 @@ func newSnapshotInfo(snapshot *btapb.Snapshot) (*SnapshotInfo, error) { tablePathParts := strings.Split(snapshot.SourceTable.Name, "/") tableID := tablePathParts[len(tablePathParts)-1] - createTime, err := ptypes.Timestamp(snapshot.CreateTime) - if err != nil { + if err := snapshot.CreateTime.CheckValid(); err != nil { return nil, fmt.Errorf("invalid createTime: %w", err) } + createTime := snapshot.CreateTime.AsTime() - deleteTime, err := ptypes.Timestamp(snapshot.DeleteTime) - if err != nil { - return nil, fmt.Errorf("invalid deleteTime: %w", err) + if err := snapshot.DeleteTime.CheckValid(); err != nil { + return nil, fmt.Errorf("invalid deleteTime: %v", err) } + deleteTime := snapshot.DeleteTime.AsTime() return &SnapshotInfo{ Name: name, @@ -1902,10 +1901,7 @@ func (ac *AdminClient) CreateBackup(ctx context.Context, table, cluster, backup ctx = mergeOutgoingMetadata(ctx, ac.md) prefix := ac.instancePrefix() - parsedExpireTime, err := ptypes.TimestampProto(expireTime) - if err != nil { - return err - } + parsedExpireTime := timestamppb.New(expireTime) req := &btapb.CreateBackupRequest{ Parent: prefix + "/clusters/" + cluster, @@ -1977,20 +1973,20 @@ func newBackupInfo(backup *btapb.Backup) (*BackupInfo, error) { tablePathParts := strings.Split(backup.SourceTable, "/") tableID := tablePathParts[len(tablePathParts)-1] - startTime, err := ptypes.Timestamp(backup.StartTime) - if err != nil { - return nil, fmt.Errorf("invalid startTime: %w", err) + if err := backup.StartTime.CheckValid(); err != nil { + return nil, fmt.Errorf("invalid startTime: %v", err) } + startTime := backup.StartTime.AsTime() - endTime, err := ptypes.Timestamp(backup.EndTime) - if err != nil { - return nil, fmt.Errorf("invalid endTime: %w", err) + if err := backup.EndTime.CheckValid(); err != nil { + return nil, fmt.Errorf("invalid endTime: %v", err) } + endTime := backup.EndTime.AsTime() - expireTime, err := ptypes.Timestamp(backup.ExpireTime) - if err != nil { - return nil, fmt.Errorf("invalid expireTime: %w", err) + if err := backup.ExpireTime.CheckValid(); err != nil { + return nil, fmt.Errorf("invalid expireTime: %v", err) } + expireTime := backup.ExpireTime.AsTime() encryptionInfo := newEncryptionInfo(backup.EncryptionInfo) bi := BackupInfo{ Name: name, @@ -2081,10 +2077,7 @@ func (ac *AdminClient) UpdateBackup(ctx context.Context, cluster, backup string, ctx = mergeOutgoingMetadata(ctx, ac.md) backupPath := ac.backupPath(cluster, ac.instance, backup) - expireTimestamp, err := ptypes.TimestampProto(expireTime) - if err != nil { - return err - } + expireTimestamp := timestamppb.New(expireTime) updateMask := &field_mask.FieldMask{} updateMask.Paths = append(updateMask.Paths, "expire_time") @@ -2096,6 +2089,6 @@ func (ac *AdminClient) UpdateBackup(ctx context.Context, cluster, backup string, }, UpdateMask: updateMask, } - _, err = ac.tClient.UpdateBackup(ctx, req) + _, err := ac.tClient.UpdateBackup(ctx, req) return err } diff --git a/bigtable/bigtable.go b/bigtable/bigtable.go index ddb8f14b0688..43993fc632e2 100644 --- a/bigtable/bigtable.go +++ b/bigtable/bigtable.go @@ -27,7 +27,6 @@ import ( btopt "cloud.google.com/go/bigtable/internal/option" "cloud.google.com/go/internal/trace" - "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" // Install google-c2p resolver, which is required for direct path. _ "google.golang.org/grpc/xds/googledirectpath" diff --git a/bigtable/bttest/inmem.go b/bigtable/bttest/inmem.go index a155d6b6f07f..aac3cf13a493 100644 --- a/bigtable/bttest/inmem.go +++ b/bigtable/bttest/inmem.go @@ -50,8 +50,6 @@ import ( "google.golang.org/protobuf/proto" longrunning "cloud.google.com/go/longrunning/autogen/longrunningpb" - emptypb "github.com/golang/protobuf/ptypes/empty" - "github.com/golang/protobuf/ptypes/wrappers" "github.com/google/btree" btapb "google.golang.org/genproto/googleapis/bigtable/admin/v2" btpb "google.golang.org/genproto/googleapis/bigtable/v2" @@ -61,7 +59,9 @@ import ( "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/durationpb" + "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" + "google.golang.org/protobuf/types/known/wrapperspb" "rsc.io/binaryregexp" ) @@ -619,8 +619,8 @@ func streamRow(stream btpb.Bigtable_ReadRowsServer, r *row, f *btpb.RowFilter, s for _, cell := range cells { rrr.Chunks = append(rrr.Chunks, &btpb.ReadRowsResponse_CellChunk{ RowKey: []byte(r.key), - FamilyName: &wrappers.StringValue{Value: fam.name}, - Qualifier: &wrappers.BytesValue{Value: []byte(colName)}, + FamilyName: &wrapperspb.StringValue{Value: fam.name}, + Qualifier: &wrapperspb.BytesValue{Value: []byte(colName)}, TimestampMicros: cell.ts, Value: cell.value, Labels: cell.labels, diff --git a/bigtable/bttest/inmem_test.go b/bigtable/bttest/inmem_test.go index 0e348e740df2..44b7aedcc354 100644 --- a/bigtable/bttest/inmem_test.go +++ b/bigtable/bttest/inmem_test.go @@ -31,14 +31,16 @@ import ( "cloud.google.com/go/bigtable/internal/option" "cloud.google.com/go/internal/testutil" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/wrappers" "github.com/google/go-cmp/cmp" btapb "google.golang.org/genproto/googleapis/bigtable/admin/v2" btpb "google.golang.org/genproto/googleapis/bigtable/v2" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" + "google.golang.org/protobuf/types/known/wrapperspb" ) func TestConcurrentMutationsReadModifyAndGC(t *testing.T) { @@ -1177,8 +1179,8 @@ func TestReadRowsReversed(t *testing.T) { wantChunks := []*btpb.ReadRowsResponse_CellChunk{ { RowKey: []byte("row2"), - FamilyName: &wrappers.StringValue{Value: "cf"}, - Qualifier: &wrappers.BytesValue{Value: []byte("cq")}, + FamilyName: &wrapperspb.StringValue{Value: "cf"}, + Qualifier: &wrapperspb.BytesValue{Value: []byte("cq")}, TimestampMicros: 1000, Value: []byte("b"), RowStatus: &btpb.ReadRowsResponse_CellChunk_CommitRow{ @@ -1187,8 +1189,8 @@ func TestReadRowsReversed(t *testing.T) { }, { RowKey: []byte("row1"), - FamilyName: &wrappers.StringValue{Value: "cf"}, - Qualifier: &wrappers.BytesValue{Value: []byte("cq")}, + FamilyName: &wrapperspb.StringValue{Value: "cf"}, + Qualifier: &wrapperspb.BytesValue{Value: []byte("cq")}, TimestampMicros: 1000, Value: []byte("a"), RowStatus: &btpb.ReadRowsResponse_CellChunk_CommitRow{ @@ -1196,7 +1198,7 @@ func TestReadRowsReversed(t *testing.T) { }, }, } - if diff := cmp.Diff(gotChunks, wantChunks, cmp.Comparer(proto.Equal)); diff != "" { + if diff := cmp.Diff(gotChunks, wantChunks, protocmp.Transform()); diff != "" { t.Fatalf("Response chunks mismatch: got: + want -\n%s", diff) } } @@ -1394,10 +1396,10 @@ func TestCheckAndMutateRowWithPredicate(t *testing.T) { wantState: []*btpb.ReadRowsResponse_CellChunk{ { RowKey: []byte("row1"), - FamilyName: &wrappers.StringValue{ + FamilyName: &wrapperspb.StringValue{ Value: "cf", }, - Qualifier: &wrappers.BytesValue{ + Qualifier: &wrapperspb.BytesValue{ Value: []byte("cq"), }, TimestampMicros: 1000, @@ -1405,10 +1407,10 @@ func TestCheckAndMutateRowWithPredicate(t *testing.T) { }, { RowKey: []byte("row1"), - FamilyName: &wrappers.StringValue{ + FamilyName: &wrapperspb.StringValue{ Value: "zf", }, - Qualifier: &wrappers.BytesValue{ + Qualifier: &wrapperspb.BytesValue{ Value: []byte("et"), }, TimestampMicros: 2000, @@ -1419,10 +1421,10 @@ func TestCheckAndMutateRowWithPredicate(t *testing.T) { }, { RowKey: []byte("row2"), - FamilyName: &wrappers.StringValue{ + FamilyName: &wrapperspb.StringValue{ Value: "df", }, - Qualifier: &wrappers.BytesValue{ + Qualifier: &wrapperspb.BytesValue{ Value: []byte("dq"), }, TimestampMicros: 1000, @@ -1433,10 +1435,10 @@ func TestCheckAndMutateRowWithPredicate(t *testing.T) { }, { RowKey: []byte("row3"), - FamilyName: &wrappers.StringValue{ + FamilyName: &wrapperspb.StringValue{ Value: "ef", }, - Qualifier: &wrappers.BytesValue{ + Qualifier: &wrapperspb.BytesValue{ Value: []byte("eq"), }, TimestampMicros: 1000, @@ -1447,10 +1449,10 @@ func TestCheckAndMutateRowWithPredicate(t *testing.T) { }, { RowKey: []byte("row4"), - FamilyName: &wrappers.StringValue{ + FamilyName: &wrapperspb.StringValue{ Value: "ff", }, - Qualifier: &wrappers.BytesValue{ + Qualifier: &wrapperspb.BytesValue{ Value: []byte("fq"), }, TimestampMicros: 1000, @@ -1865,10 +1867,10 @@ func TestFilterRow(t *testing.T) { } { got, err := filterRow(test.filter, row.copy()) if err != nil { - t.Errorf("%s: got unexpected error: %v", proto.CompactTextString(test.filter), err) + t.Errorf("%s: got unexpected error: %v", prototext.Format(test.filter), err) } if got != test.want { - t.Errorf("%s: got %t, want %t", proto.CompactTextString(test.filter), got, test.want) + t.Errorf("%s: got %t, want %t", prototext.Format(test.filter), got, test.want) } } } @@ -1912,10 +1914,10 @@ func TestFilterRowWithErrors(t *testing.T) { } { got, err := filterRow(test.badRegex, row.copy()) if got != false { - t.Errorf("%s: got true, want false", proto.CompactTextString(test.badRegex)) + t.Errorf("%s: got true, want false", prototext.Format(test.badRegex)) } if err == nil { - t.Errorf("%s: got no error, want error", proto.CompactTextString(test.badRegex)) + t.Errorf("%s: got no error, want error", prototext.Format(test.badRegex)) } } } @@ -2111,8 +2113,8 @@ func TestFilterRowWithSingleColumnQualifier(t *testing.T) { Chunks: []*btpb.ReadRowsResponse_CellChunk{ { RowKey: []byte("row3"), - FamilyName: &wrappers.StringValue{Value: "cf"}, - Qualifier: &wrappers.BytesValue{Value: []byte("cq")}, + FamilyName: &wrapperspb.StringValue{Value: "cf"}, + Qualifier: &wrapperspb.BytesValue{Value: []byte("cq")}, TimestampMicros: 1000, Value: []byte("a"), RowStatus: &btpb.ReadRowsResponse_CellChunk_CommitRow{ @@ -2199,8 +2201,8 @@ func TestValueFilterRowWithAlternationInRegex(t *testing.T) { wantChunks := []*btpb.ReadRowsResponse_CellChunk{ { RowKey: []byte("row1"), - FamilyName: &wrappers.StringValue{Value: "cf"}, - Qualifier: &wrappers.BytesValue{Value: []byte("cq")}, + FamilyName: &wrapperspb.StringValue{Value: "cf"}, + Qualifier: &wrapperspb.BytesValue{Value: []byte("cq")}, TimestampMicros: 1000, Value: []byte(""), RowStatus: &btpb.ReadRowsResponse_CellChunk_CommitRow{ @@ -2209,8 +2211,8 @@ func TestValueFilterRowWithAlternationInRegex(t *testing.T) { }, { RowKey: []byte("row3"), - FamilyName: &wrappers.StringValue{Value: "cf"}, - Qualifier: &wrappers.BytesValue{Value: []byte("cq")}, + FamilyName: &wrapperspb.StringValue{Value: "cf"}, + Qualifier: &wrapperspb.BytesValue{Value: []byte("cq")}, TimestampMicros: 1000, Value: []byte("a"), RowStatus: &btpb.ReadRowsResponse_CellChunk_CommitRow{ @@ -2296,10 +2298,10 @@ func TestFilterRowCellsPerRowLimitFilterTruthiness(t *testing.T) { } { got, err := filterRow(test.filter, row.copy()) if err != nil { - t.Errorf("%s: got unexpected error: %v", proto.CompactTextString(test.filter), err) + t.Errorf("%s: got unexpected error: %v", prototext.Format(test.filter), err) } if got != test.want { - t.Errorf("%s: got %t, want %t", proto.CompactTextString(test.filter), got, test.want) + t.Errorf("%s: got %t, want %t", prototext.Format(test.filter), got, test.want) } } } diff --git a/bigtable/bttest/instance_server.go b/bigtable/bttest/instance_server.go index a96b6b6dc427..570c78894d89 100644 --- a/bigtable/bttest/instance_server.go +++ b/bigtable/bttest/instance_server.go @@ -20,10 +20,10 @@ import ( "cloud.google.com/go/iam/apiv1/iampb" longrunning "cloud.google.com/go/longrunning/autogen/longrunningpb" - "github.com/golang/protobuf/ptypes/empty" btapb "google.golang.org/genproto/googleapis/bigtable/admin/v2" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/emptypb" ) var _ btapb.BigtableInstanceAdminServer = (*server)(nil) @@ -58,7 +58,7 @@ var ( regInstanceName = regexp.MustCompile(instanceNameRegRaw) ) -func (s *server) DeleteInstance(ctx context.Context, req *btapb.DeleteInstanceRequest) (*empty.Empty, error) { +func (s *server) DeleteInstance(ctx context.Context, req *btapb.DeleteInstanceRequest) (*emptypb.Empty, error) { name := req.GetName() if !regInstanceName.Match([]byte(name)) { return nil, status.Errorf(codes.InvalidArgument, @@ -77,7 +77,7 @@ func (s *server) DeleteInstance(ctx context.Context, req *btapb.DeleteInstanceRe // Then finally remove the instance. delete(s.instances, name) - return new(empty.Empty), nil + return new(emptypb.Empty), nil } func (s *server) CreateCluster(ctx context.Context, req *btapb.CreateClusterRequest) (*longrunning.Operation, error) { @@ -96,7 +96,7 @@ func (s *server) UpdateCluster(ctx context.Context, req *btapb.Cluster) (*longru return nil, errUnimplemented } -func (s *server) DeleteCluster(ctx context.Context, req *btapb.DeleteClusterRequest) (*empty.Empty, error) { +func (s *server) DeleteCluster(ctx context.Context, req *btapb.DeleteClusterRequest) (*emptypb.Empty, error) { return nil, errUnimplemented } @@ -116,7 +116,7 @@ func (s *server) UpdateAppProfile(ctx context.Context, req *btapb.UpdateAppProfi return nil, errUnimplemented } -func (s *server) DeleteAppProfile(ctx context.Context, req *btapb.DeleteAppProfileRequest) (*empty.Empty, error) { +func (s *server) DeleteAppProfile(ctx context.Context, req *btapb.DeleteAppProfileRequest) (*emptypb.Empty, error) { return nil, errUnimplemented } diff --git a/bigtable/conformance_test.go b/bigtable/conformance_test.go index d11aaab999c2..f23f2b0db1d9 100644 --- a/bigtable/conformance_test.go +++ b/bigtable/conformance_test.go @@ -17,7 +17,6 @@ limitations under the License. package bigtable import ( - "bytes" "context" "io/ioutil" "path/filepath" @@ -28,10 +27,10 @@ import ( pb "cloud.google.com/go/bigtable/internal/conformance" "cloud.google.com/go/bigtable/internal/mockserver" - "github.com/golang/protobuf/jsonpb" "google.golang.org/api/option" btpb "google.golang.org/genproto/googleapis/bigtable/v2" "google.golang.org/grpc" + "google.golang.org/protobuf/encoding/protojson" ) func TestConformance(t *testing.T) { @@ -66,7 +65,7 @@ func TestConformance(t *testing.T) { } var tf pb.TestFile - if err := jsonpb.Unmarshal(bytes.NewReader(inBytes), &tf); err != nil { + if err := protojson.Unmarshal(inBytes, &tf); err != nil { t.Fatalf("unmarshalling %s: %v", f, err) } diff --git a/bigtable/gc.go b/bigtable/gc.go index 36d916673b5a..d2e6a3828765 100644 --- a/bigtable/gc.go +++ b/bigtable/gc.go @@ -21,8 +21,8 @@ import ( "strings" "time" - durpb "github.com/golang/protobuf/ptypes/duration" bttdpb "google.golang.org/genproto/googleapis/bigtable/admin/v2" + "google.golang.org/protobuf/types/known/durationpb" ) // PolicyType represents the type of GCPolicy @@ -168,7 +168,7 @@ func (ma MaxAgeGCPolicy) proto() *bttdpb.GcRule { // Fix this if people care about GC policies over 290 years. ns := time.Duration(ma).Nanoseconds() return &bttdpb.GcRule{ - Rule: &bttdpb.GcRule_MaxAge{MaxAge: &durpb.Duration{ + Rule: &bttdpb.GcRule_MaxAge{MaxAge: &durationpb.Duration{ Seconds: ns / 1e9, Nanos: int32(ns % 1e9), }}, diff --git a/bigtable/go.mod b/bigtable/go.mod index c2c248f26ab2..bff8106edef2 100644 --- a/bigtable/go.mod +++ b/bigtable/go.mod @@ -6,7 +6,6 @@ require ( cloud.google.com/go v0.110.4 cloud.google.com/go/iam v1.1.1 cloud.google.com/go/longrunning v0.5.1 - github.com/golang/protobuf v1.5.3 github.com/google/btree v1.1.2 github.com/google/go-cmp v0.5.9 github.com/googleapis/cloud-bigtable-clients-test v0.0.0-20230505150253-16eeee810d3a @@ -29,6 +28,7 @@ require ( github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f // indirect github.com/envoyproxy/protoc-gen-validate v0.10.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/google/s2a-go v0.1.4 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect diff --git a/bigtable/integration_test.go b/bigtable/integration_test.go index a26dd8c8dcc2..edcf96c06dbc 100644 --- a/bigtable/integration_test.go +++ b/bigtable/integration_test.go @@ -37,7 +37,6 @@ import ( "cloud.google.com/go/internal" "cloud.google.com/go/internal/testutil" "cloud.google.com/go/internal/uid" - "github.com/golang/protobuf/proto" "github.com/google/go-cmp/cmp" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" @@ -45,6 +44,7 @@ import ( grpc "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) const ( diff --git a/bigtable/internal/conformance/README.md b/bigtable/internal/conformance/README.md index 7c5b86c50b4f..43ee0ce96e12 100644 --- a/bigtable/internal/conformance/README.md +++ b/bigtable/internal/conformance/README.md @@ -5,4 +5,4 @@ # you've installed https://github.com/googleapis/googleapis. # Note: Run whilst cd-ed in this directory. protoc --go_out=. -I /usr/local/google/home/deklerk/workspace/googleapis -I . *.proto -``` \ No newline at end of file +``` diff --git a/bigtable/internal/conformance/tests.pb.go b/bigtable/internal/conformance/tests.pb.go index dffb8407706d..e3f91aa73af3 100644 --- a/bigtable/internal/conformance/tests.pb.go +++ b/bigtable/internal/conformance/tests.pb.go @@ -1,117 +1,147 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.2 // source: tests.proto -package google_cloud_conformance_bigtable_v2 +package conformance import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" v2 "google.golang.org/genproto/googleapis/bigtable/v2" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type TestFile struct { - ReadRowsTests []*ReadRowsTest `protobuf:"bytes,1,rep,name=read_rows_tests,json=readRowsTests,proto3" json:"read_rows_tests,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *TestFile) Reset() { *m = TestFile{} } -func (m *TestFile) String() string { return proto.CompactTextString(m) } -func (*TestFile) ProtoMessage() {} -func (*TestFile) Descriptor() ([]byte, []int) { - return fileDescriptor_e49b496f4919bda1, []int{0} + ReadRowsTests []*ReadRowsTest `protobuf:"bytes,1,rep,name=read_rows_tests,json=readRowsTests,proto3" json:"read_rows_tests,omitempty"` } -func (m *TestFile) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TestFile.Unmarshal(m, b) -} -func (m *TestFile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TestFile.Marshal(b, m, deterministic) -} -func (m *TestFile) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestFile.Merge(m, src) +func (x *TestFile) Reset() { + *x = TestFile{} + if protoimpl.UnsafeEnabled { + mi := &file_tests_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *TestFile) XXX_Size() int { - return xxx_messageInfo_TestFile.Size(m) + +func (x *TestFile) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TestFile) XXX_DiscardUnknown() { - xxx_messageInfo_TestFile.DiscardUnknown(m) + +func (*TestFile) ProtoMessage() {} + +func (x *TestFile) ProtoReflect() protoreflect.Message { + mi := &file_tests_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_TestFile proto.InternalMessageInfo +// Deprecated: Use TestFile.ProtoReflect.Descriptor instead. +func (*TestFile) Descriptor() ([]byte, []int) { + return file_tests_proto_rawDescGZIP(), []int{0} +} -func (m *TestFile) GetReadRowsTests() []*ReadRowsTest { - if m != nil { - return m.ReadRowsTests +func (x *TestFile) GetReadRowsTests() []*ReadRowsTest { + if x != nil { + return x.ReadRowsTests } return nil } type ReadRowsTest struct { - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - Chunks []*v2.ReadRowsResponse_CellChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks,omitempty"` - Results []*ReadRowsTest_Result `protobuf:"bytes,3,rep,name=results,proto3" json:"results,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ReadRowsTest) Reset() { *m = ReadRowsTest{} } -func (m *ReadRowsTest) String() string { return proto.CompactTextString(m) } -func (*ReadRowsTest) ProtoMessage() {} -func (*ReadRowsTest) Descriptor() ([]byte, []int) { - return fileDescriptor_e49b496f4919bda1, []int{1} + Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` + Chunks []*v2.ReadRowsResponse_CellChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks,omitempty"` + Results []*ReadRowsTest_Result `protobuf:"bytes,3,rep,name=results,proto3" json:"results,omitempty"` } -func (m *ReadRowsTest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReadRowsTest.Unmarshal(m, b) -} -func (m *ReadRowsTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReadRowsTest.Marshal(b, m, deterministic) -} -func (m *ReadRowsTest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadRowsTest.Merge(m, src) +func (x *ReadRowsTest) Reset() { + *x = ReadRowsTest{} + if protoimpl.UnsafeEnabled { + mi := &file_tests_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ReadRowsTest) XXX_Size() int { - return xxx_messageInfo_ReadRowsTest.Size(m) + +func (x *ReadRowsTest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ReadRowsTest) XXX_DiscardUnknown() { - xxx_messageInfo_ReadRowsTest.DiscardUnknown(m) + +func (*ReadRowsTest) ProtoMessage() {} + +func (x *ReadRowsTest) ProtoReflect() protoreflect.Message { + mi := &file_tests_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ReadRowsTest proto.InternalMessageInfo +// Deprecated: Use ReadRowsTest.ProtoReflect.Descriptor instead. +func (*ReadRowsTest) Descriptor() ([]byte, []int) { + return file_tests_proto_rawDescGZIP(), []int{1} +} -func (m *ReadRowsTest) GetDescription() string { - if m != nil { - return m.Description +func (x *ReadRowsTest) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *ReadRowsTest) GetChunks() []*v2.ReadRowsResponse_CellChunk { - if m != nil { - return m.Chunks +func (x *ReadRowsTest) GetChunks() []*v2.ReadRowsResponse_CellChunk { + if x != nil { + return x.Chunks } return nil } -func (m *ReadRowsTest) GetResults() []*ReadRowsTest_Result { - if m != nil { - return m.Results +func (x *ReadRowsTest) GetResults() []*ReadRowsTest_Result { + if x != nil { + return x.Results } return nil } @@ -119,126 +149,243 @@ func (m *ReadRowsTest) GetResults() []*ReadRowsTest_Result { // Expected results of reading the row. // Only the last result can be an error. type ReadRowsTest_Result struct { - RowKey string `protobuf:"bytes,1,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` - FamilyName string `protobuf:"bytes,2,opt,name=family_name,json=familyName,proto3" json:"family_name,omitempty"` - Qualifier string `protobuf:"bytes,3,opt,name=qualifier,proto3" json:"qualifier,omitempty"` - TimestampMicros int64 `protobuf:"varint,4,opt,name=timestamp_micros,json=timestampMicros,proto3" json:"timestamp_micros,omitempty"` - Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` - Label string `protobuf:"bytes,6,opt,name=label,proto3" json:"label,omitempty"` - Error bool `protobuf:"varint,7,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReadRowsTest_Result) Reset() { *m = ReadRowsTest_Result{} } -func (m *ReadRowsTest_Result) String() string { return proto.CompactTextString(m) } -func (*ReadRowsTest_Result) ProtoMessage() {} -func (*ReadRowsTest_Result) Descriptor() ([]byte, []int) { - return fileDescriptor_e49b496f4919bda1, []int{1, 0} -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ReadRowsTest_Result) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReadRowsTest_Result.Unmarshal(m, b) + RowKey string `protobuf:"bytes,1,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` + FamilyName string `protobuf:"bytes,2,opt,name=family_name,json=familyName,proto3" json:"family_name,omitempty"` + Qualifier string `protobuf:"bytes,3,opt,name=qualifier,proto3" json:"qualifier,omitempty"` + TimestampMicros int64 `protobuf:"varint,4,opt,name=timestamp_micros,json=timestampMicros,proto3" json:"timestamp_micros,omitempty"` + Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` + Label string `protobuf:"bytes,6,opt,name=label,proto3" json:"label,omitempty"` + Error bool `protobuf:"varint,7,opt,name=error,proto3" json:"error,omitempty"` } -func (m *ReadRowsTest_Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReadRowsTest_Result.Marshal(b, m, deterministic) -} -func (m *ReadRowsTest_Result) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadRowsTest_Result.Merge(m, src) + +func (x *ReadRowsTest_Result) Reset() { + *x = ReadRowsTest_Result{} + if protoimpl.UnsafeEnabled { + mi := &file_tests_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ReadRowsTest_Result) XXX_Size() int { - return xxx_messageInfo_ReadRowsTest_Result.Size(m) + +func (x *ReadRowsTest_Result) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ReadRowsTest_Result) XXX_DiscardUnknown() { - xxx_messageInfo_ReadRowsTest_Result.DiscardUnknown(m) + +func (*ReadRowsTest_Result) ProtoMessage() {} + +func (x *ReadRowsTest_Result) ProtoReflect() protoreflect.Message { + mi := &file_tests_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ReadRowsTest_Result proto.InternalMessageInfo +// Deprecated: Use ReadRowsTest_Result.ProtoReflect.Descriptor instead. +func (*ReadRowsTest_Result) Descriptor() ([]byte, []int) { + return file_tests_proto_rawDescGZIP(), []int{1, 0} +} -func (m *ReadRowsTest_Result) GetRowKey() string { - if m != nil { - return m.RowKey +func (x *ReadRowsTest_Result) GetRowKey() string { + if x != nil { + return x.RowKey } return "" } -func (m *ReadRowsTest_Result) GetFamilyName() string { - if m != nil { - return m.FamilyName +func (x *ReadRowsTest_Result) GetFamilyName() string { + if x != nil { + return x.FamilyName } return "" } -func (m *ReadRowsTest_Result) GetQualifier() string { - if m != nil { - return m.Qualifier +func (x *ReadRowsTest_Result) GetQualifier() string { + if x != nil { + return x.Qualifier } return "" } -func (m *ReadRowsTest_Result) GetTimestampMicros() int64 { - if m != nil { - return m.TimestampMicros +func (x *ReadRowsTest_Result) GetTimestampMicros() int64 { + if x != nil { + return x.TimestampMicros } return 0 } -func (m *ReadRowsTest_Result) GetValue() string { - if m != nil { - return m.Value +func (x *ReadRowsTest_Result) GetValue() string { + if x != nil { + return x.Value } return "" } -func (m *ReadRowsTest_Result) GetLabel() string { - if m != nil { - return m.Label +func (x *ReadRowsTest_Result) GetLabel() string { + if x != nil { + return x.Label } return "" } -func (m *ReadRowsTest_Result) GetError() bool { - if m != nil { - return m.Error +func (x *ReadRowsTest_Result) GetError() bool { + if x != nil { + return x.Error } return false } -func init() { - proto.RegisterType((*TestFile)(nil), "google.cloud.conformance.bigtable.v2.TestFile") - proto.RegisterType((*ReadRowsTest)(nil), "google.cloud.conformance.bigtable.v2.ReadRowsTest") - proto.RegisterType((*ReadRowsTest_Result)(nil), "google.cloud.conformance.bigtable.v2.ReadRowsTest.Result") -} - -func init() { proto.RegisterFile("tests.proto", fileDescriptor_e49b496f4919bda1) } - -var fileDescriptor_e49b496f4919bda1 = []byte{ - // 404 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xc1, 0x6e, 0xd4, 0x30, - 0x10, 0x86, 0x95, 0x0d, 0xcd, 0xb6, 0x5e, 0xa0, 0xc8, 0x42, 0xc2, 0xaa, 0x90, 0x08, 0x15, 0x87, - 0xc0, 0xc1, 0x95, 0xc2, 0x89, 0xeb, 0x2e, 0x2a, 0x07, 0x04, 0x07, 0x83, 0x38, 0x70, 0x89, 0xbc, - 0xd9, 0xc9, 0x62, 0xd5, 0xce, 0x04, 0xdb, 0xd9, 0x68, 0x1f, 0x86, 0x17, 0xe0, 0x5d, 0x78, 0x27, - 0x14, 0xbb, 0x69, 0xf7, 0xc0, 0x61, 0xb9, 0xe5, 0xff, 0xc6, 0xff, 0x3f, 0xf6, 0x4c, 0xc8, 0xc2, - 0x83, 0xf3, 0x8e, 0x77, 0x16, 0x3d, 0xd2, 0x57, 0x5b, 0xc4, 0xad, 0x06, 0x5e, 0x6b, 0xec, 0x37, - 0xbc, 0xc6, 0xb6, 0x41, 0x6b, 0x64, 0x5b, 0x03, 0x5f, 0xab, 0xad, 0x97, 0x6b, 0x0d, 0x7c, 0x57, - 0x5e, 0xbc, 0x8c, 0xa7, 0xae, 0x26, 0x76, 0xb5, 0x2b, 0xef, 0xbe, 0x63, 0xd0, 0x65, 0x43, 0x4e, - 0xbf, 0x82, 0xf3, 0xd7, 0x4a, 0x03, 0xfd, 0x4e, 0xce, 0x2d, 0xc8, 0x4d, 0x65, 0x71, 0x70, 0x55, - 0xe8, 0xc6, 0x92, 0x3c, 0x2d, 0x16, 0x65, 0xc9, 0x8f, 0x69, 0xc7, 0x05, 0xc8, 0x8d, 0xc0, 0xc1, - 0x8d, 0x81, 0xe2, 0x91, 0x3d, 0x50, 0xee, 0xf2, 0x57, 0x4a, 0x1e, 0x1e, 0xd6, 0x69, 0x4e, 0x16, - 0x1b, 0x70, 0xb5, 0x55, 0x9d, 0x57, 0xd8, 0xb2, 0x24, 0x4f, 0x8a, 0x33, 0x71, 0x88, 0xe8, 0x35, - 0xc9, 0xea, 0x1f, 0x7d, 0x7b, 0xe3, 0xd8, 0x2c, 0xdc, 0x82, 0x4f, 0xb7, 0xf8, 0x57, 0x4f, 0x01, - 0xae, 0xc3, 0xd6, 0x01, 0x5f, 0x81, 0xd6, 0xab, 0xd1, 0x26, 0x6e, 0xdd, 0xf4, 0x0b, 0x99, 0x5b, - 0x70, 0xbd, 0xf6, 0x8e, 0xa5, 0x21, 0xe8, 0xdd, 0xff, 0x3f, 0x87, 0x8b, 0x90, 0x20, 0xa6, 0xa4, - 0x8b, 0x3f, 0x09, 0xc9, 0x22, 0xa3, 0xcf, 0xc8, 0xdc, 0xe2, 0x50, 0xdd, 0xc0, 0xfe, 0xf6, 0x15, - 0x99, 0xc5, 0xe1, 0x23, 0xec, 0xe9, 0x0b, 0xb2, 0x68, 0xa4, 0x51, 0x7a, 0x5f, 0xb5, 0xd2, 0x00, - 0x9b, 0x85, 0x22, 0x89, 0xe8, 0xb3, 0x34, 0x40, 0x9f, 0x93, 0xb3, 0x9f, 0xbd, 0xd4, 0xaa, 0x51, - 0x60, 0x59, 0x1a, 0xca, 0xf7, 0x80, 0xbe, 0x26, 0x4f, 0xbc, 0x32, 0xe0, 0xbc, 0x34, 0x5d, 0x65, - 0x54, 0x6d, 0xd1, 0xb1, 0x07, 0x79, 0x52, 0xa4, 0xe2, 0xfc, 0x8e, 0x7f, 0x0a, 0x98, 0x3e, 0x25, - 0x27, 0x3b, 0xa9, 0x7b, 0x60, 0x27, 0x21, 0x24, 0x8a, 0x91, 0x6a, 0xb9, 0x06, 0xcd, 0xb2, 0x48, - 0x83, 0x18, 0x29, 0x58, 0x8b, 0x96, 0xcd, 0xf3, 0xa4, 0x38, 0x15, 0x51, 0x2c, 0xb7, 0xa4, 0xa8, - 0xd1, 0x1c, 0x35, 0x98, 0xe5, 0xe3, 0x71, 0x22, 0xef, 0xa1, 0x51, 0xad, 0x1a, 0x17, 0xf5, 0x7b, - 0xf6, 0xe6, 0x43, 0xb4, 0xad, 0x82, 0x6d, 0x39, 0x1d, 0xfd, 0x56, 0xf2, 0xb0, 0x7c, 0xbe, 0xba, - 0x0f, 0x5a, 0x67, 0xe1, 0xbf, 0x7b, 0xfb, 0x37, 0x00, 0x00, 0xff, 0xff, 0x51, 0xe2, 0xc6, 0xe8, - 0xcf, 0x02, 0x00, 0x00, +var File_tests_proto protoreflect.FileDescriptor + +var file_tests_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x74, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x24, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x62, 0x69, 0x67, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x2e, 0x76, 0x32, 0x1a, 0x21, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x62, 0x69, 0x67, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x62, 0x69, 0x67, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x66, 0x0a, 0x08, 0x54, 0x65, 0x73, 0x74, 0x46, 0x69, + 0x6c, 0x65, 0x12, 0x5a, 0x0a, 0x0f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x5f, + 0x74, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x62, 0x69, 0x67, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x54, 0x65, 0x73, 0x74, 0x52, + 0x0d, 0x72, 0x65, 0x61, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x54, 0x65, 0x73, 0x74, 0x73, 0x22, 0x9d, + 0x03, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x54, 0x65, 0x73, 0x74, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x46, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x62, 0x69, 0x67, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x65, 0x6c, 0x6c, 0x43, 0x68, 0x75, 0x6e, + 0x6b, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12, 0x53, 0x0a, 0x07, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, + 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x62, 0x69, 0x67, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x54, 0x65, 0x73, 0x74, 0x2e, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x1a, 0xcd, + 0x01, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x77, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x77, 0x4b, + 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6d, + 0x69, 0x63, 0x72, 0x6f, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x9a, + 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, + 0x62, 0x69, 0x67, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x76, 0x32, 0x42, 0x0e, 0x54, 0x65, 0x73, + 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5a, 0x31, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, + 0x2f, 0x62, 0x69, 0x67, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0xaa, 0x02, + 0x2a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x42, 0x69, + 0x67, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x56, 0x32, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x73, 0x2e, + 0x43, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_tests_proto_rawDescOnce sync.Once + file_tests_proto_rawDescData = file_tests_proto_rawDesc +) + +func file_tests_proto_rawDescGZIP() []byte { + file_tests_proto_rawDescOnce.Do(func() { + file_tests_proto_rawDescData = protoimpl.X.CompressGZIP(file_tests_proto_rawDescData) + }) + return file_tests_proto_rawDescData +} + +var file_tests_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_tests_proto_goTypes = []interface{}{ + (*TestFile)(nil), // 0: google.cloud.conformance.bigtable.v2.TestFile + (*ReadRowsTest)(nil), // 1: google.cloud.conformance.bigtable.v2.ReadRowsTest + (*ReadRowsTest_Result)(nil), // 2: google.cloud.conformance.bigtable.v2.ReadRowsTest.Result + (*v2.ReadRowsResponse_CellChunk)(nil), // 3: google.bigtable.v2.ReadRowsResponse.CellChunk +} +var file_tests_proto_depIdxs = []int32{ + 1, // 0: google.cloud.conformance.bigtable.v2.TestFile.read_rows_tests:type_name -> google.cloud.conformance.bigtable.v2.ReadRowsTest + 3, // 1: google.cloud.conformance.bigtable.v2.ReadRowsTest.chunks:type_name -> google.bigtable.v2.ReadRowsResponse.CellChunk + 2, // 2: google.cloud.conformance.bigtable.v2.ReadRowsTest.results:type_name -> google.cloud.conformance.bigtable.v2.ReadRowsTest.Result + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_tests_proto_init() } +func file_tests_proto_init() { + if File_tests_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_tests_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TestFile); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tests_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadRowsTest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tests_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadRowsTest_Result); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_tests_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_tests_proto_goTypes, + DependencyIndexes: file_tests_proto_depIdxs, + MessageInfos: file_tests_proto_msgTypes, + }.Build() + File_tests_proto = out.File + file_tests_proto_rawDesc = nil + file_tests_proto_goTypes = nil + file_tests_proto_depIdxs = nil } diff --git a/bigtable/internal/conformance/tests.proto b/bigtable/internal/conformance/tests.proto index 694f27625eeb..303a06b53716 100644 --- a/bigtable/internal/conformance/tests.proto +++ b/bigtable/internal/conformance/tests.proto @@ -1,10 +1,10 @@ -// Copyright 2019, Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -21,6 +21,7 @@ import "google/bigtable/v2/bigtable.proto"; option csharp_namespace = "Google.Cloud.Bigtable.V2.Tests.Conformance"; option java_outer_classname = "TestDefinition"; option java_package = "com.google.cloud.conformance.bigtable.v2"; +option go_package = "cloud.google.com/go/bigtable/internal/conformance"; message TestFile { repeated ReadRowsTest read_rows_tests = 1; diff --git a/bigtable/internal/testproxy/proxy.go b/bigtable/internal/testproxy/proxy.go index 441a9d2b8f63..16cf6e4e68fd 100644 --- a/bigtable/internal/testproxy/proxy.go +++ b/bigtable/internal/testproxy/proxy.go @@ -26,7 +26,6 @@ import ( "time" "cloud.google.com/go/bigtable" - "github.com/golang/protobuf/ptypes/duration" pb "github.com/googleapis/cloud-bigtable-clients-test/testproxypb" "google.golang.org/api/option" btpb "google.golang.org/genproto/googleapis/bigtable/v2" @@ -35,6 +34,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials/insecure" stat "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/durationpb" ) var ( @@ -369,9 +369,9 @@ func parseTableID(tableName string) (tableID string, _ error) { // made using the client, an appProfileID (optionally), and a // perOperationTimeout (optionally). type testClient struct { - c *bigtable.Client // c stores the Bigtable client under test - appProfileID string // appProfileID is currently unused - perOperationTimeout *duration.Duration // perOperationTimeout sets a custom timeout for methods calls on this client + c *bigtable.Client // c stores the Bigtable client under test + appProfileID string // appProfileID is currently unused + perOperationTimeout *durationpb.Duration // perOperationTimeout sets a custom timeout for methods calls on this client } // timeout adds a timeout setting to a context if perOperationTimeout is set on diff --git a/bigtable/reader_test.go b/bigtable/reader_test.go index 00f453f91db6..52e4d2b43f65 100644 --- a/bigtable/reader_test.go +++ b/bigtable/reader_test.go @@ -24,9 +24,9 @@ import ( "testing" "cloud.google.com/go/internal/testutil" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/wrappers" btspb "google.golang.org/genproto/googleapis/bigtable/v2" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/types/known/wrapperspb" ) // Indicates that a field in the proto should be omitted, rather than included @@ -275,7 +275,7 @@ func runTestCase(t *testing.T, test TestCase) { for _, chunkText := range test.Chunks { // Parse and pass each cell chunk to the ChunkReader cc := &btspb.ReadRowsResponse_CellChunk{} - err := proto.UnmarshalText(chunkText, cc) + err := prototext.Unmarshal([]byte(chunkText), cc) if err != nil { t.Errorf("[%s] failed to unmarshal text proto: %s\n%s", test.Name, chunkText, err) return @@ -340,16 +340,16 @@ func cc(rk string, fm string, qual string, ts int64, val string, size int32, com rkWrapper = []byte(rk) } - var fmWrapper *wrappers.StringValue + var fmWrapper *wrapperspb.StringValue if fm != nilStr { - fmWrapper = &wrappers.StringValue{Value: fm} + fmWrapper = &wrapperspb.StringValue{Value: fm} } else { fmWrapper = nil } - var qualWrapper *wrappers.BytesValue + var qualWrapper *wrapperspb.BytesValue if qual != nilStr { - qualWrapper = &wrappers.BytesValue{Value: []byte(qual)} + qualWrapper = &wrapperspb.BytesValue{Value: []byte(qual)} } else { qualWrapper = nil } diff --git a/bigtable/retry_test.go b/bigtable/retry_test.go index 54565e97fefb..69e6fda42cc0 100644 --- a/bigtable/retry_test.go +++ b/bigtable/retry_test.go @@ -23,7 +23,6 @@ import ( "cloud.google.com/go/bigtable/bttest" "cloud.google.com/go/internal/testutil" - "github.com/golang/protobuf/ptypes/wrappers" "github.com/google/go-cmp/cmp" "google.golang.org/api/option" btpb "google.golang.org/genproto/googleapis/bigtable/v2" @@ -31,6 +30,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/wrapperspb" ) func setupFakeServer(opt ...grpc.ServerOption) (tbl *Table, cleanup func(), err error) { @@ -444,8 +444,8 @@ func writeReadRowsResponse(ss grpc.ServerStream, rowKeys ...string) error { for _, key := range rowKeys { chunks = append(chunks, &btpb.ReadRowsResponse_CellChunk{ RowKey: []byte(key), - FamilyName: &wrappers.StringValue{Value: "fm"}, - Qualifier: &wrappers.BytesValue{Value: []byte("col")}, + FamilyName: &wrapperspb.StringValue{Value: "fm"}, + Qualifier: &wrapperspb.BytesValue{Value: []byte("col")}, RowStatus: &btpb.ReadRowsResponse_CellChunk_CommitRow{CommitRow: true}, }) }