From 6d8327eb73acf2322dcb64e973d8ca6829520a1c Mon Sep 17 00:00:00 2001 From: Abhishek Chatterjee Date: Wed, 17 Dec 2025 17:14:07 +0530 Subject: [PATCH 1/7] Implement seed storing for Java schema tests . Remember seeds of failing test cases and rerun --- stefc/generator/testdata/seeds/java/README.md | 15 +++++ ...test.optional_reset_fail_Struct1_seeds.txt | 2 + stefc/templates/java/writerTest.java.tmpl | 55 +++++++++++++++---- 3 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 stefc/generator/testdata/seeds/java/README.md create mode 100644 stefc/generator/testdata/seeds/java/com.example.gentest.optional_reset_fail_Struct1_seeds.txt diff --git a/stefc/generator/testdata/seeds/java/README.md b/stefc/generator/testdata/seeds/java/README.md new file mode 100644 index 00000000..dd54de81 --- /dev/null +++ b/stefc/generator/testdata/seeds/java/README.md @@ -0,0 +1,15 @@ +This directory stores **random seeds that previously caused failures in Java-generated schema tests** (e.g. `*WriterTest`). + +## Why this exists + +- When a randomized Java writer/reader test fails, it prints the seed and **appends it** to the appropriate `*_seeds.txt` file in this directory. +- On subsequent test runs, the seeds in these files are **replayed first** to ensure the bug does not regress. + +## File naming convention +Each file is named: +`__seeds.txt` +Example: +`com.example.otelstef_Metrics_seeds.txt` + +## Important +- Only add seeds that were found by **Java** failures. Go/other-language seeds are not portable because RNGs differ. \ No newline at end of file diff --git a/stefc/generator/testdata/seeds/java/com.example.gentest.optional_reset_fail_Struct1_seeds.txt b/stefc/generator/testdata/seeds/java/com.example.gentest.optional_reset_fail_Struct1_seeds.txt new file mode 100644 index 00000000..803ff0fa --- /dev/null +++ b/stefc/generator/testdata/seeds/java/com.example.gentest.optional_reset_fail_Struct1_seeds.txt @@ -0,0 +1,2 @@ +1765233907441407000 +1765234703981295000 \ No newline at end of file diff --git a/stefc/templates/java/writerTest.java.tmpl b/stefc/templates/java/writerTest.java.tmpl index ead7c808..afc08c8e 100644 --- a/stefc/templates/java/writerTest.java.tmpl +++ b/stefc/templates/java/writerTest.java.tmpl @@ -11,6 +11,10 @@ import static org.junit.jupiter.api.Assertions.*; import java.io.ByteArrayInputStream; import java.io.EOFException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -35,8 +39,9 @@ class {{.StructName}}WriterTest { return records; } - @Test - void test{{.StructName}}WriteRead() throws Exception { + boolean test{{.StructName}}WriteReadSeed(long seed) { + boolean retVal = true; + List opts = Arrays.asList( WriterOptions.builder(), WriterOptions.builder().compression(Compression.Zstd), @@ -61,12 +66,9 @@ class {{.StructName}}WriterTest { WriterOptions.builder().frameRestartFlags(FrameFlags.RestartCodecs).maxUncompressedFrameByteSize(500) ); - // Choose a seed (non-pseudo) randomly. We will print the seed - // on failure for easy reproduction. - long seed1 = System.nanoTime(); - Random random = new Random(seed1); + Random random = new Random(seed); - for (int optIdx=0; optIdx < opts.size(); optIdx++) { + for (int optIdx = 0; optIdx < opts.size(); optIdx++) { WriterOptions.Builder opt = opts.get(optIdx); try { MemChunkWriter buf = new MemChunkWriter(); @@ -85,12 +87,43 @@ class {{.StructName}}WriterTest { {{.StructName}}Reader reader = new {{.StructName}}Reader(new ByteArrayInputStream(buf.getBytes())); for (int i = 0; i < records.size(); i++) { assertEquals(ReadResult.Success, reader.read(ReadOptions.none)); - assertTrue(reader.record.equals(records.get(i)), "record " + i + " seed " + seed1 + " optIdx " + optIdx); + assertTrue(reader.record.equals(records.get(i)), "record " + i + " seed " + seed + " optIdx " + optIdx); } assertThrows(EOFException.class, () -> reader.read(ReadOptions.none)); - } catch (Exception e) { - fail("seed " + seed1 + " optIdx " + optIdx + ": " + e.getMessage()); + } catch (Throwable t) { + System.out.printf("Test failed with seed %d optIdx %d: %s%n", seed, optIdx, t); + retVal = false; + } + } + + return retVal; + } + + @Test + void test{{.StructName}}WriteRead() throws Exception { + // Seed files are stored in-repo so previously-failing seeds can be replayed to prevent regressions. + Path seedFilePath = Paths.get("../stefc/generator/testdata/seeds/java/{{ .PackageName }}_{{.StructName}}_seeds.txt"); + + if (Files.exists(seedFilePath)) { + for (String line : Files.readAllLines(seedFilePath)) { + String s = line.trim(); + if (s.isEmpty()) continue; + long seed = Long.parseLong(s); + System.out.printf("Testing with seed from file: %d%n", seed); + boolean passed = test{{.StructName}}WriteReadSeed(seed); + if (!passed) { + fail("Previously-failing seed " + seed + " still fails"); + } } } + + long seed = System.nanoTime(); + boolean succeeded = test{{.StructName}}WriteReadSeed(seed); + if (!succeeded) { + System.out.printf("Test failed with seed %d, adding to seed file%n", seed); + Files.createDirectories(seedFilePath.getParent()); + Files.writeString(seedFilePath, seed + "\n", StandardOpenOption.CREATE, StandardOpenOption.APPEND); + fail("Test failed with seed " + seed); + } } -} +} \ No newline at end of file From b7ee108b6e9587809663c80e0a829df2bf83ff15 Mon Sep 17 00:00:00 2001 From: Abhishek Chatterjee Date: Fri, 19 Dec 2025 09:50:38 +0530 Subject: [PATCH 2/7] Implement seed storing for Java schema tests . Remember seeds of failing test cases and rerun --- examples/jsonl/internal/jsonpb/jsonl.pb.go | 260 +++++--------- go/grpc/stef_proto/destination.pb.go | 338 ++++++------------ go/grpc/stef_proto/destination_grpc.pb.go | 94 ++--- ...example.gentest.json_like_Record_seeds.txt | 1 + 4 files changed, 228 insertions(+), 465 deletions(-) create mode 100644 stefc/generator/testdata/seeds/java/com.example.gentest.json_like_Record_seeds.txt diff --git a/examples/jsonl/internal/jsonpb/jsonl.pb.go b/examples/jsonl/internal/jsonpb/jsonl.pb.go index 62c18e94..e8096c50 100644 --- a/examples/jsonl/internal/jsonpb/jsonl.pb.go +++ b/examples/jsonl/internal/jsonpb/jsonl.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v5.29.5 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: jsonl.proto package jsonpb @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,20 +22,17 @@ const ( ) type Record struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Value *JsonValue `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields - - Value *JsonValue `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Record) Reset() { *x = Record{} - if protoimpl.UnsafeEnabled { - mi := &file_jsonl_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_jsonl_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Record) String() string { @@ -45,7 +43,7 @@ func (*Record) ProtoMessage() {} func (x *Record) ProtoReflect() protoreflect.Message { mi := &file_jsonl_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -68,27 +66,24 @@ func (x *Record) GetValue() *JsonValue { } type JsonValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Kind: + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Kind: // // *JsonValue_Object // *JsonValue_Array // *JsonValue_String_ // *JsonValue_Number // *JsonValue_Bool - Kind isJsonValue_Kind `protobuf_oneof:"kind"` + Kind isJsonValue_Kind `protobuf_oneof:"kind"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *JsonValue) Reset() { *x = JsonValue{} - if protoimpl.UnsafeEnabled { - mi := &file_jsonl_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_jsonl_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *JsonValue) String() string { @@ -99,7 +94,7 @@ func (*JsonValue) ProtoMessage() {} func (x *JsonValue) ProtoReflect() protoreflect.Message { mi := &file_jsonl_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -114,44 +109,54 @@ func (*JsonValue) Descriptor() ([]byte, []int) { return file_jsonl_proto_rawDescGZIP(), []int{1} } -func (m *JsonValue) GetKind() isJsonValue_Kind { - if m != nil { - return m.Kind +func (x *JsonValue) GetKind() isJsonValue_Kind { + if x != nil { + return x.Kind } return nil } func (x *JsonValue) GetObject() *JsonObject { - if x, ok := x.GetKind().(*JsonValue_Object); ok { - return x.Object + if x != nil { + if x, ok := x.Kind.(*JsonValue_Object); ok { + return x.Object + } } return nil } func (x *JsonValue) GetArray() *JsonArray { - if x, ok := x.GetKind().(*JsonValue_Array); ok { - return x.Array + if x != nil { + if x, ok := x.Kind.(*JsonValue_Array); ok { + return x.Array + } } return nil } func (x *JsonValue) GetString_() string { - if x, ok := x.GetKind().(*JsonValue_String_); ok { - return x.String_ + if x != nil { + if x, ok := x.Kind.(*JsonValue_String_); ok { + return x.String_ + } } return "" } func (x *JsonValue) GetNumber() float64 { - if x, ok := x.GetKind().(*JsonValue_Number); ok { - return x.Number + if x != nil { + if x, ok := x.Kind.(*JsonValue_Number); ok { + return x.Number + } } return 0 } func (x *JsonValue) GetBool() bool { - if x, ok := x.GetKind().(*JsonValue_Bool); ok { - return x.Bool + if x != nil { + if x, ok := x.Kind.(*JsonValue_Bool); ok { + return x.Bool + } } return false } @@ -191,20 +196,17 @@ func (*JsonValue_Number) isJsonValue_Kind() {} func (*JsonValue_Bool) isJsonValue_Kind() {} type JsonObject struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Elems []*JsonObjectElem `protobuf:"bytes,1,rep,name=elems,proto3" json:"elems,omitempty"` unknownFields protoimpl.UnknownFields - - Elems []*JsonObjectElem `protobuf:"bytes,1,rep,name=elems,proto3" json:"elems,omitempty"` + sizeCache protoimpl.SizeCache } func (x *JsonObject) Reset() { *x = JsonObject{} - if protoimpl.UnsafeEnabled { - mi := &file_jsonl_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_jsonl_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *JsonObject) String() string { @@ -215,7 +217,7 @@ func (*JsonObject) ProtoMessage() {} func (x *JsonObject) ProtoReflect() protoreflect.Message { mi := &file_jsonl_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -238,21 +240,18 @@ func (x *JsonObject) GetElems() []*JsonObjectElem { } type JsonObjectElem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value *JsonValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value *JsonValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + sizeCache protoimpl.SizeCache } func (x *JsonObjectElem) Reset() { *x = JsonObjectElem{} - if protoimpl.UnsafeEnabled { - mi := &file_jsonl_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_jsonl_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *JsonObjectElem) String() string { @@ -263,7 +262,7 @@ func (*JsonObjectElem) ProtoMessage() {} func (x *JsonObjectElem) ProtoReflect() protoreflect.Message { mi := &file_jsonl_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -294,20 +293,17 @@ func (x *JsonObjectElem) GetValue() *JsonValue { // Array of JsonValue type JsonArray struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Values []*JsonValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` unknownFields protoimpl.UnknownFields - - Values []*JsonValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` + sizeCache protoimpl.SizeCache } func (x *JsonArray) Reset() { *x = JsonArray{} - if protoimpl.UnsafeEnabled { - mi := &file_jsonl_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_jsonl_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *JsonArray) String() string { @@ -318,7 +314,7 @@ func (*JsonArray) ProtoMessage() {} func (x *JsonArray) ProtoReflect() protoreflect.Message { mi := &file_jsonl_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -342,56 +338,41 @@ func (x *JsonArray) GetValues() []*JsonValue { var File_jsonl_proto protoreflect.FileDescriptor -var file_jsonl_proto_rawDesc = []byte{ - 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x6a, - 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x22, 0x31, 0x0a, 0x06, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, - 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, - 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xb6, 0x01, 0x0a, 0x09, 0x4a, 0x73, 0x6f, - 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2e, - 0x4a, 0x73, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x06, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x12, 0x29, 0x0a, 0x05, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4a, 0x73, 0x6f, - 0x6e, 0x41, 0x72, 0x72, 0x61, 0x79, 0x48, 0x00, 0x52, 0x05, 0x61, 0x72, 0x72, 0x61, 0x79, 0x12, - 0x18, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x0a, 0x06, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x06, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, - 0x64, 0x22, 0x3a, 0x0a, 0x0a, 0x4a, 0x73, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, - 0x2c, 0x0a, 0x05, 0x65, 0x6c, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x52, 0x05, 0x65, 0x6c, 0x65, 0x6d, 0x73, 0x22, 0x4b, 0x0a, - 0x0e, 0x4a, 0x73, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x36, 0x0a, 0x09, 0x4a, 0x73, - 0x6f, 0x6e, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x29, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, - 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x73, 0x70, 0x6c, 0x75, 0x6e, 0x6b, 0x2f, 0x73, 0x74, 0x65, 0x66, 0x2f, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} +const file_jsonl_proto_rawDesc = "" + + "\n" + + "\vjsonl.proto\x12\x06jsonpb\"1\n" + + "\x06Record\x12'\n" + + "\x05value\x18\x01 \x01(\v2\x11.jsonpb.JsonValueR\x05value\"\xb6\x01\n" + + "\tJsonValue\x12,\n" + + "\x06object\x18\x01 \x01(\v2\x12.jsonpb.JsonObjectH\x00R\x06object\x12)\n" + + "\x05array\x18\x02 \x01(\v2\x11.jsonpb.JsonArrayH\x00R\x05array\x12\x18\n" + + "\x06string\x18\x03 \x01(\tH\x00R\x06string\x12\x18\n" + + "\x06number\x18\x04 \x01(\x01H\x00R\x06number\x12\x14\n" + + "\x04bool\x18\x05 \x01(\bH\x00R\x04boolB\x06\n" + + "\x04kind\":\n" + + "\n" + + "JsonObject\x12,\n" + + "\x05elems\x18\x01 \x03(\v2\x16.jsonpb.JsonObjectElemR\x05elems\"K\n" + + "\x0eJsonObjectElem\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12'\n" + + "\x05value\x18\x02 \x01(\v2\x11.jsonpb.JsonValueR\x05value\"6\n" + + "\tJsonArray\x12)\n" + + "\x06values\x18\x01 \x03(\v2\x11.jsonpb.JsonValueR\x06valuesB7Z5github.com/splunk/stef/examples/jsonl/internal/jsonpbb\x06proto3" var ( file_jsonl_proto_rawDescOnce sync.Once - file_jsonl_proto_rawDescData = file_jsonl_proto_rawDesc + file_jsonl_proto_rawDescData []byte ) func file_jsonl_proto_rawDescGZIP() []byte { file_jsonl_proto_rawDescOnce.Do(func() { - file_jsonl_proto_rawDescData = protoimpl.X.CompressGZIP(file_jsonl_proto_rawDescData) + file_jsonl_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_jsonl_proto_rawDesc), len(file_jsonl_proto_rawDesc))) }) return file_jsonl_proto_rawDescData } var file_jsonl_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_jsonl_proto_goTypes = []interface{}{ +var file_jsonl_proto_goTypes = []any{ (*Record)(nil), // 0: jsonpb.Record (*JsonValue)(nil), // 1: jsonpb.JsonValue (*JsonObject)(nil), // 2: jsonpb.JsonObject @@ -417,69 +398,7 @@ func file_jsonl_proto_init() { if File_jsonl_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_jsonl_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Record); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_jsonl_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JsonValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_jsonl_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JsonObject); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_jsonl_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JsonObjectElem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_jsonl_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JsonArray); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_jsonl_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_jsonl_proto_msgTypes[1].OneofWrappers = []any{ (*JsonValue_Object)(nil), (*JsonValue_Array)(nil), (*JsonValue_String_)(nil), @@ -490,7 +409,7 @@ func file_jsonl_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_jsonl_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_jsonl_proto_rawDesc), len(file_jsonl_proto_rawDesc)), NumEnums: 0, NumMessages: 5, NumExtensions: 0, @@ -501,7 +420,6 @@ func file_jsonl_proto_init() { MessageInfos: file_jsonl_proto_msgTypes, }.Build() File_jsonl_proto = out.File - file_jsonl_proto_rawDesc = nil file_jsonl_proto_goTypes = nil file_jsonl_proto_depIdxs = nil } diff --git a/go/grpc/stef_proto/destination.pb.go b/go/grpc/stef_proto/destination.pb.go index b8e97168..01b36f2c 100644 --- a/go/grpc/stef_proto/destination.pb.go +++ b/go/grpc/stef_proto/destination.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v5.29.5 +// protoc-gen-go v1.36.11 +// protoc v6.33.2 // source: destination.proto package stef_proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,10 +22,7 @@ const ( ) type STEFClientMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The client MUST set first_message field in the first STEFClientMessage sent. // All other fields MUST be unset when first_message is set. // All subsequent messages MUST have first_message unset. @@ -40,16 +38,16 @@ type STEFClientMessage struct { // the chunk is encountered and only then start decoding the chunk. // Clients MUST ensure they mark this field true at least once in a while otherwise // recipients may never start decoding the data. - IsEndOfChunk bool `protobuf:"varint,3,opt,name=is_end_of_chunk,json=isEndOfChunk,proto3" json:"is_end_of_chunk,omitempty"` + IsEndOfChunk bool `protobuf:"varint,3,opt,name=is_end_of_chunk,json=isEndOfChunk,proto3" json:"is_end_of_chunk,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *STEFClientMessage) Reset() { *x = STEFClientMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_destination_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_destination_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *STEFClientMessage) String() string { @@ -60,7 +58,7 @@ func (*STEFClientMessage) ProtoMessage() {} func (x *STEFClientMessage) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -103,24 +101,21 @@ func (x *STEFClientMessage) GetIsEndOfChunk() bool { // destination. The client MUST NOT send STEF data until it receives // STEFDestinationCapabilities message from the destination. type STEFClientFirstMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // The name of the root struct of the client's schema. This is useful // for destinations that accept multiple schemas and need to know which schema // the client is using. The destination will use this information to // determine the schema to use for decoding the data. RootStructName string `protobuf:"bytes,1,opt,name=root_struct_name,json=rootStructName,proto3" json:"root_struct_name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *STEFClientFirstMessage) Reset() { *x = STEFClientFirstMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_destination_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_destination_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *STEFClientFirstMessage) String() string { @@ -131,7 +126,7 @@ func (*STEFClientFirstMessage) ProtoMessage() {} func (x *STEFClientFirstMessage) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -154,10 +149,7 @@ func (x *STEFClientFirstMessage) GetRootStructName() string { } type STEFDestinationCapabilities struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // dictionary_limits of the destination. The client MUST honor the limits. DictionaryLimits *STEFDictionaryLimits `protobuf:"bytes,1,opt,name=dictionary_limits,json=dictionaryLimits,proto3" json:"dictionary_limits,omitempty"` // schema is the STEF schema supported by the destination. The schema description @@ -174,16 +166,16 @@ type STEFDestinationCapabilities struct { // 4. The schema is incompatible with client's schema (neither an exact match, nor a // subset or superset). The client and the destination are incompatible and cannot // communicate. The client MUST close the stream, further communication is not possible. - Schema []byte `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` + Schema []byte `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *STEFDestinationCapabilities) Reset() { *x = STEFDestinationCapabilities{} - if protoimpl.UnsafeEnabled { - mi := &file_destination_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_destination_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *STEFDestinationCapabilities) String() string { @@ -194,7 +186,7 @@ func (*STEFDestinationCapabilities) ProtoMessage() {} func (x *STEFDestinationCapabilities) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -227,10 +219,7 @@ func (x *STEFDestinationCapabilities) GetSchema() []byte { // are reached the sender will reset the dictionaries. This prevents the // dictionaries growing indefinitely large. type STEFDictionaryLimits struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Maximum total in-memory byte size of all dictionaries. // 0 means no limit. // The sender's total byte size calculation may be approximate. Senders @@ -240,16 +229,16 @@ type STEFDictionaryLimits struct { // the sender computes and what receiver's re-created dictionary ends up using. // Receivers that are memory constrained should specify conservatively low values // for the limit. - MaxDictBytes uint64 `protobuf:"varint,2,opt,name=max_dict_bytes,json=maxDictBytes,proto3" json:"max_dict_bytes,omitempty"` + MaxDictBytes uint64 `protobuf:"varint,2,opt,name=max_dict_bytes,json=maxDictBytes,proto3" json:"max_dict_bytes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *STEFDictionaryLimits) Reset() { *x = STEFDictionaryLimits{} - if protoimpl.UnsafeEnabled { - mi := &file_destination_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_destination_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *STEFDictionaryLimits) String() string { @@ -260,7 +249,7 @@ func (*STEFDictionaryLimits) ProtoMessage() {} func (x *STEFDictionaryLimits) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -283,27 +272,24 @@ func (x *STEFDictionaryLimits) GetMaxDictBytes() uint64 { } type STEFServerMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // TODO: refactor this to avoid using oneof message to reduce // allocations for the most common case of STEFDataResponse. // - // Types that are assignable to Message: + // Types that are valid to be assigned to Message: // // *STEFServerMessage_Capabilities // *STEFServerMessage_Response - Message isSTEFServerMessage_Message `protobuf_oneof:"message"` + Message isSTEFServerMessage_Message `protobuf_oneof:"message"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *STEFServerMessage) Reset() { *x = STEFServerMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_destination_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_destination_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *STEFServerMessage) String() string { @@ -314,7 +300,7 @@ func (*STEFServerMessage) ProtoMessage() {} func (x *STEFServerMessage) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -329,23 +315,27 @@ func (*STEFServerMessage) Descriptor() ([]byte, []int) { return file_destination_proto_rawDescGZIP(), []int{4} } -func (m *STEFServerMessage) GetMessage() isSTEFServerMessage_Message { - if m != nil { - return m.Message +func (x *STEFServerMessage) GetMessage() isSTEFServerMessage_Message { + if x != nil { + return x.Message } return nil } func (x *STEFServerMessage) GetCapabilities() *STEFDestinationCapabilities { - if x, ok := x.GetMessage().(*STEFServerMessage_Capabilities); ok { - return x.Capabilities + if x != nil { + if x, ok := x.Message.(*STEFServerMessage_Capabilities); ok { + return x.Capabilities + } } return nil } func (x *STEFServerMessage) GetResponse() *STEFDataResponse { - if x, ok := x.GetMessage().(*STEFServerMessage_Response); ok { - return x.Response + if x != nil { + if x, ok := x.Message.(*STEFServerMessage_Response); ok { + return x.Response + } } return nil } @@ -367,10 +357,7 @@ func (*STEFServerMessage_Capabilities) isSTEFServerMessage_Message() {} func (*STEFServerMessage_Response) isSTEFServerMessage_Message() {} type STEFDataResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // ack_record_id acknowledges receipt of STEF data // with record_id <= ack_record_id. // @@ -388,15 +375,15 @@ type STEFDataResponse struct { // This field is optional. When empty it means there is no bad data, // all data up to ack_record_id was successfully processed. BadDataRecordIdRanges []*STEFIDRange `protobuf:"bytes,2,rep,name=bad_data_record_id_ranges,json=badDataRecordIdRanges,proto3" json:"bad_data_record_id_ranges,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *STEFDataResponse) Reset() { *x = STEFDataResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_destination_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_destination_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *STEFDataResponse) String() string { @@ -407,7 +394,7 @@ func (*STEFDataResponse) ProtoMessage() {} func (x *STEFDataResponse) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -437,23 +424,20 @@ func (x *STEFDataResponse) GetBadDataRecordIdRanges() []*STEFIDRange { } type STEFIDRange struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // From ID, inclusive. FromId uint64 `protobuf:"varint,1,opt,name=from_id,json=fromId,proto3" json:"from_id,omitempty"` // To ID, inclusive. - ToId uint64 `protobuf:"varint,2,opt,name=to_id,json=toId,proto3" json:"to_id,omitempty"` + ToId uint64 `protobuf:"varint,2,opt,name=to_id,json=toId,proto3" json:"to_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *STEFIDRange) Reset() { *x = STEFIDRange{} - if protoimpl.UnsafeEnabled { - mi := &file_destination_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_destination_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *STEFIDRange) String() string { @@ -464,7 +448,7 @@ func (*STEFIDRange) ProtoMessage() {} func (x *STEFIDRange) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -495,80 +479,49 @@ func (x *STEFIDRange) GetToId() uint64 { var File_destination_proto protoreflect.FileDescriptor -var file_destination_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x01, 0x0a, 0x11, 0x53, 0x54, 0x45, 0x46, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x66, 0x69, 0x72, - 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x53, 0x54, 0x45, 0x46, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x72, - 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0c, 0x66, 0x69, 0x72, 0x73, 0x74, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x65, 0x66, 0x5f, - 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x65, - 0x66, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0f, 0x69, 0x73, 0x5f, 0x65, 0x6e, 0x64, - 0x5f, 0x6f, 0x66, 0x5f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0c, 0x69, 0x73, 0x45, 0x6e, 0x64, 0x4f, 0x66, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0x42, 0x0a, - 0x16, 0x53, 0x54, 0x45, 0x46, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x72, 0x73, 0x74, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x72, 0x6f, 0x6f, 0x74, 0x5f, - 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x72, 0x6f, 0x6f, 0x74, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x22, 0x79, 0x0a, 0x1b, 0x53, 0x54, 0x45, 0x46, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, - 0x12, 0x42, 0x0a, 0x11, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x5f, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x53, 0x54, - 0x45, 0x46, 0x44, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x73, 0x52, 0x10, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x3c, 0x0a, 0x14, - 0x53, 0x54, 0x45, 0x46, 0x44, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x69, 0x63, 0x74, - 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6d, 0x61, - 0x78, 0x44, 0x69, 0x63, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x93, 0x01, 0x0a, 0x11, 0x53, - 0x54, 0x45, 0x46, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x42, 0x0a, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x53, 0x54, 0x45, 0x46, 0x44, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x69, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x69, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x53, 0x54, 0x45, 0x46, 0x44, 0x61, 0x74, - 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x22, 0x7e, 0x0a, 0x10, 0x53, 0x54, 0x45, 0x46, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x63, 0x6b, 0x5f, 0x72, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x61, 0x63, 0x6b, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x19, 0x62, 0x61, 0x64, 0x5f, - 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x5f, 0x72, - 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x53, 0x54, - 0x45, 0x46, 0x49, 0x44, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x15, 0x62, 0x61, 0x64, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x22, 0x3b, 0x0a, 0x0b, 0x53, 0x54, 0x45, 0x46, 0x49, 0x44, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, - 0x17, 0x0a, 0x07, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x06, 0x66, 0x72, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x6f, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, 0x6f, 0x49, 0x64, 0x32, 0x49, 0x0a, - 0x0f, 0x53, 0x54, 0x45, 0x46, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x36, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x12, 0x2e, 0x53, 0x54, 0x45, - 0x46, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x12, - 0x2e, 0x53, 0x54, 0x45, 0x46, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x32, 0x0a, 0x21, 0x6e, 0x65, 0x74, 0x2e, - 0x73, 0x74, 0x65, 0x66, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x01, 0x5a, - 0x0b, 0x2f, 0x73, 0x74, 0x65, 0x66, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} +const file_destination_proto_rawDesc = "" + + "\n" + + "\x11destination.proto\"\x97\x01\n" + + "\x11STEFClientMessage\x12<\n" + + "\rfirst_message\x18\x01 \x01(\v2\x17.STEFClientFirstMessageR\ffirstMessage\x12\x1d\n" + + "\n" + + "stef_bytes\x18\x02 \x01(\fR\tstefBytes\x12%\n" + + "\x0fis_end_of_chunk\x18\x03 \x01(\bR\fisEndOfChunk\"B\n" + + "\x16STEFClientFirstMessage\x12(\n" + + "\x10root_struct_name\x18\x01 \x01(\tR\x0erootStructName\"y\n" + + "\x1bSTEFDestinationCapabilities\x12B\n" + + "\x11dictionary_limits\x18\x01 \x01(\v2\x15.STEFDictionaryLimitsR\x10dictionaryLimits\x12\x16\n" + + "\x06schema\x18\x02 \x01(\fR\x06schema\"<\n" + + "\x14STEFDictionaryLimits\x12$\n" + + "\x0emax_dict_bytes\x18\x02 \x01(\x04R\fmaxDictBytes\"\x93\x01\n" + + "\x11STEFServerMessage\x12B\n" + + "\fcapabilities\x18\x01 \x01(\v2\x1c.STEFDestinationCapabilitiesH\x00R\fcapabilities\x12/\n" + + "\bresponse\x18\x02 \x01(\v2\x11.STEFDataResponseH\x00R\bresponseB\t\n" + + "\amessage\"~\n" + + "\x10STEFDataResponse\x12\"\n" + + "\rack_record_id\x18\x01 \x01(\x04R\vackRecordId\x12F\n" + + "\x19bad_data_record_id_ranges\x18\x02 \x03(\v2\f.STEFIDRangeR\x15badDataRecordIdRanges\";\n" + + "\vSTEFIDRange\x12\x17\n" + + "\afrom_id\x18\x01 \x01(\x04R\x06fromId\x12\x13\n" + + "\x05to_id\x18\x02 \x01(\x04R\x04toId2I\n" + + "\x0fSTEFDestination\x126\n" + + "\x06Stream\x12\x12.STEFClientMessage\x1a\x12.STEFServerMessage\"\x00(\x010\x01B2\n" + + "!net.stef.grpc.service.destinationP\x01Z\v/stef_protob\x06proto3" var ( file_destination_proto_rawDescOnce sync.Once - file_destination_proto_rawDescData = file_destination_proto_rawDesc + file_destination_proto_rawDescData []byte ) func file_destination_proto_rawDescGZIP() []byte { file_destination_proto_rawDescOnce.Do(func() { - file_destination_proto_rawDescData = protoimpl.X.CompressGZIP(file_destination_proto_rawDescData) + file_destination_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_destination_proto_rawDesc), len(file_destination_proto_rawDesc))) }) return file_destination_proto_rawDescData } var file_destination_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_destination_proto_goTypes = []interface{}{ +var file_destination_proto_goTypes = []any{ (*STEFClientMessage)(nil), // 0: STEFClientMessage (*STEFClientFirstMessage)(nil), // 1: STEFClientFirstMessage (*STEFDestinationCapabilities)(nil), // 2: STEFDestinationCapabilities @@ -597,93 +550,7 @@ func file_destination_proto_init() { if File_destination_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_destination_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*STEFClientMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_destination_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*STEFClientFirstMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_destination_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*STEFDestinationCapabilities); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_destination_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*STEFDictionaryLimits); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_destination_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*STEFServerMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_destination_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*STEFDataResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_destination_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*STEFIDRange); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_destination_proto_msgTypes[4].OneofWrappers = []interface{}{ + file_destination_proto_msgTypes[4].OneofWrappers = []any{ (*STEFServerMessage_Capabilities)(nil), (*STEFServerMessage_Response)(nil), } @@ -691,7 +558,7 @@ func file_destination_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_destination_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_destination_proto_rawDesc), len(file_destination_proto_rawDesc)), NumEnums: 0, NumMessages: 7, NumExtensions: 0, @@ -702,7 +569,6 @@ func file_destination_proto_init() { MessageInfos: file_destination_proto_msgTypes, }.Build() File_destination_proto = out.File - file_destination_proto_rawDesc = nil file_destination_proto_goTypes = nil file_destination_proto_depIdxs = nil } diff --git a/go/grpc/stef_proto/destination_grpc.pb.go b/go/grpc/stef_proto/destination_grpc.pb.go index d292913d..a048ca9f 100644 --- a/go/grpc/stef_proto/destination_grpc.pb.go +++ b/go/grpc/stef_proto/destination_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.29.5 +// - protoc-gen-go-grpc v1.6.0 +// - protoc v6.33.2 // source: destination.proto package stef_proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( STEFDestination_Stream_FullMethodName = "/STEFDestination/Stream" @@ -25,6 +25,8 @@ const ( // STEFDestinationClient is the client API for STEFDestination service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Destination is a service to which STEF data can be sent. type STEFDestinationClient interface { // Stream is a channel to send STEF data from the client to Destination. // Once the stream is open the Destination MUST send a ServerMessage with @@ -34,7 +36,7 @@ type STEFDestinationClient interface { // ClientMessage containing STEF data. The Destination MUST periodically // respond with ServerMessage containing ExportResponse field. // One gRPC stream corresponds to one STEF byte stream. - Stream(ctx context.Context, opts ...grpc.CallOption) (STEFDestination_StreamClient, error) + Stream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[STEFClientMessage, STEFServerMessage], error) } type sTEFDestinationClient struct { @@ -45,40 +47,24 @@ func NewSTEFDestinationClient(cc grpc.ClientConnInterface) STEFDestinationClient return &sTEFDestinationClient{cc} } -func (c *sTEFDestinationClient) Stream(ctx context.Context, opts ...grpc.CallOption) (STEFDestination_StreamClient, error) { - stream, err := c.cc.NewStream(ctx, &STEFDestination_ServiceDesc.Streams[0], STEFDestination_Stream_FullMethodName, opts...) +func (c *sTEFDestinationClient) Stream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[STEFClientMessage, STEFServerMessage], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &STEFDestination_ServiceDesc.Streams[0], STEFDestination_Stream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &sTEFDestinationStreamClient{stream} + x := &grpc.GenericClientStream[STEFClientMessage, STEFServerMessage]{ClientStream: stream} return x, nil } -type STEFDestination_StreamClient interface { - Send(*STEFClientMessage) error - Recv() (*STEFServerMessage, error) - grpc.ClientStream -} - -type sTEFDestinationStreamClient struct { - grpc.ClientStream -} - -func (x *sTEFDestinationStreamClient) Send(m *STEFClientMessage) error { - return x.ClientStream.SendMsg(m) -} - -func (x *sTEFDestinationStreamClient) Recv() (*STEFServerMessage, error) { - m := new(STEFServerMessage) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type STEFDestination_StreamClient = grpc.BidiStreamingClient[STEFClientMessage, STEFServerMessage] // STEFDestinationServer is the server API for STEFDestination service. // All implementations must embed UnimplementedSTEFDestinationServer -// for forward compatibility +// for forward compatibility. +// +// Destination is a service to which STEF data can be sent. type STEFDestinationServer interface { // Stream is a channel to send STEF data from the client to Destination. // Once the stream is open the Destination MUST send a ServerMessage with @@ -88,18 +74,22 @@ type STEFDestinationServer interface { // ClientMessage containing STEF data. The Destination MUST periodically // respond with ServerMessage containing ExportResponse field. // One gRPC stream corresponds to one STEF byte stream. - Stream(STEFDestination_StreamServer) error + Stream(grpc.BidiStreamingServer[STEFClientMessage, STEFServerMessage]) error mustEmbedUnimplementedSTEFDestinationServer() } -// UnimplementedSTEFDestinationServer must be embedded to have forward compatible implementations. -type UnimplementedSTEFDestinationServer struct { -} +// UnimplementedSTEFDestinationServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedSTEFDestinationServer struct{} -func (UnimplementedSTEFDestinationServer) Stream(STEFDestination_StreamServer) error { - return status.Errorf(codes.Unimplemented, "method Stream not implemented") +func (UnimplementedSTEFDestinationServer) Stream(grpc.BidiStreamingServer[STEFClientMessage, STEFServerMessage]) error { + return status.Error(codes.Unimplemented, "method Stream not implemented") } func (UnimplementedSTEFDestinationServer) mustEmbedUnimplementedSTEFDestinationServer() {} +func (UnimplementedSTEFDestinationServer) testEmbeddedByValue() {} // UnsafeSTEFDestinationServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to STEFDestinationServer will @@ -109,34 +99,22 @@ type UnsafeSTEFDestinationServer interface { } func RegisterSTEFDestinationServer(s grpc.ServiceRegistrar, srv STEFDestinationServer) { + // If the following call panics, it indicates UnimplementedSTEFDestinationServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&STEFDestination_ServiceDesc, srv) } func _STEFDestination_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(STEFDestinationServer).Stream(&sTEFDestinationStreamServer{stream}) -} - -type STEFDestination_StreamServer interface { - Send(*STEFServerMessage) error - Recv() (*STEFClientMessage, error) - grpc.ServerStream -} - -type sTEFDestinationStreamServer struct { - grpc.ServerStream + return srv.(STEFDestinationServer).Stream(&grpc.GenericServerStream[STEFClientMessage, STEFServerMessage]{ServerStream: stream}) } -func (x *sTEFDestinationStreamServer) Send(m *STEFServerMessage) error { - return x.ServerStream.SendMsg(m) -} - -func (x *sTEFDestinationStreamServer) Recv() (*STEFClientMessage, error) { - m := new(STEFClientMessage) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type STEFDestination_StreamServer = grpc.BidiStreamingServer[STEFClientMessage, STEFServerMessage] // STEFDestination_ServiceDesc is the grpc.ServiceDesc for STEFDestination service. // It's only intended for direct use with grpc.RegisterService, diff --git a/stefc/generator/testdata/seeds/java/com.example.gentest.json_like_Record_seeds.txt b/stefc/generator/testdata/seeds/java/com.example.gentest.json_like_Record_seeds.txt new file mode 100644 index 00000000..dece55ee --- /dev/null +++ b/stefc/generator/testdata/seeds/java/com.example.gentest.json_like_Record_seeds.txt @@ -0,0 +1 @@ +680413050164375 From 28dc03137b69889870f0dab843486a3448caa52c Mon Sep 17 00:00:00 2001 From: Abhishek Chatterjee Date: Fri, 19 Dec 2025 13:30:09 +0530 Subject: [PATCH 3/7] Resolving CoPilot comments --- stefc/templates/java/writerTest.java.tmpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stefc/templates/java/writerTest.java.tmpl b/stefc/templates/java/writerTest.java.tmpl index afc08c8e..40fbd52d 100644 --- a/stefc/templates/java/writerTest.java.tmpl +++ b/stefc/templates/java/writerTest.java.tmpl @@ -90,8 +90,9 @@ class {{.StructName}}WriterTest { assertTrue(reader.record.equals(records.get(i)), "record " + i + " seed " + seed + " optIdx " + optIdx); } assertThrows(EOFException.class, () -> reader.read(ReadOptions.none)); - } catch (Throwable t) { - System.out.printf("Test failed with seed %d optIdx %d: %s%n", seed, optIdx, t); + } catch (Exception e) { + System.out.printf("Test failed with seed %d optIdx %d: %s%n", seed, optIdx, e.getMessage()); + e.printStackTrace(); retVal = false; } } From 5c987241a3e6ba41b5577987c1e0295989144f49 Mon Sep 17 00:00:00 2001 From: Abhishek Chatterjee Date: Fri, 19 Dec 2025 14:26:31 +0530 Subject: [PATCH 4/7] Update stefc/generator/testdata/seeds/java/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- stefc/generator/testdata/seeds/java/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stefc/generator/testdata/seeds/java/README.md b/stefc/generator/testdata/seeds/java/README.md index dd54de81..d6370226 100644 --- a/stefc/generator/testdata/seeds/java/README.md +++ b/stefc/generator/testdata/seeds/java/README.md @@ -9,7 +9,7 @@ This directory stores **random seeds that previously caused failures in Java-gen Each file is named: `__seeds.txt` Example: -`com.example.otelstef_Metrics_seeds.txt` +`com.example.gentest.json_like_Record_seeds.txt` ## Important - Only add seeds that were found by **Java** failures. Go/other-language seeds are not portable because RNGs differ. \ No newline at end of file From ae8025592909e51e235eba86e5dd42b76628b58a Mon Sep 17 00:00:00 2001 From: Abhishek Chatterjee Date: Mon, 22 Dec 2025 19:02:36 +0530 Subject: [PATCH 5/7] Regenerated the files after reverting the changes with protoc version v5.29.5 --- examples/jsonl/internal/jsonpb/jsonl.pb.go | 2 +- go/grpc/stef_proto/destination.pb.go | 2 +- go/grpc/stef_proto/destination_grpc.pb.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/jsonl/internal/jsonpb/jsonl.pb.go b/examples/jsonl/internal/jsonpb/jsonl.pb.go index e8096c50..c6ea02f8 100644 --- a/examples/jsonl/internal/jsonpb/jsonl.pb.go +++ b/examples/jsonl/internal/jsonpb/jsonl.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v6.33.2 +// protoc v5.29.5 // source: jsonl.proto package jsonpb diff --git a/go/grpc/stef_proto/destination.pb.go b/go/grpc/stef_proto/destination.pb.go index 01b36f2c..a53963c8 100644 --- a/go/grpc/stef_proto/destination.pb.go +++ b/go/grpc/stef_proto/destination.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v6.33.2 +// protoc v5.29.5 // source: destination.proto package stef_proto diff --git a/go/grpc/stef_proto/destination_grpc.pb.go b/go/grpc/stef_proto/destination_grpc.pb.go index a048ca9f..bd234d35 100644 --- a/go/grpc/stef_proto/destination_grpc.pb.go +++ b/go/grpc/stef_proto/destination_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 -// - protoc v6.33.2 +// - protoc v5.29.5 // source: destination.proto package stef_proto From 8b2a84c831b9a754bdb3743283e55307ec6782be Mon Sep 17 00:00:00 2001 From: Abhishek Chatterjee Date: Mon, 22 Dec 2025 19:24:37 +0530 Subject: [PATCH 6/7] Regenerated the files after reverting the changes with protoc version v5.29.5 --- examples/jsonl/internal/jsonpb/jsonl.pb.go | 260 ++++++++++------ go/grpc/stef_proto/destination.pb.go | 338 ++++++++++++++------- go/grpc/stef_proto/destination_grpc.pb.go | 94 +++--- 3 files changed, 465 insertions(+), 227 deletions(-) diff --git a/examples/jsonl/internal/jsonpb/jsonl.pb.go b/examples/jsonl/internal/jsonpb/jsonl.pb.go index c6ea02f8..ece7d8a0 100644 --- a/examples/jsonl/internal/jsonpb/jsonl.pb.go +++ b/examples/jsonl/internal/jsonpb/jsonl.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.26.0 // protoc v5.29.5 // source: jsonl.proto @@ -11,7 +11,6 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" - unsafe "unsafe" ) const ( @@ -22,17 +21,20 @@ const ( ) type Record struct { - state protoimpl.MessageState `protogen:"open.v1"` - Value *JsonValue `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value *JsonValue `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` } func (x *Record) Reset() { *x = Record{} - mi := &file_jsonl_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_jsonl_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *Record) String() string { @@ -43,7 +45,7 @@ func (*Record) ProtoMessage() {} func (x *Record) ProtoReflect() protoreflect.Message { mi := &file_jsonl_proto_msgTypes[0] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -66,24 +68,27 @@ func (x *Record) GetValue() *JsonValue { } type JsonValue struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Kind: + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Kind: // // *JsonValue_Object // *JsonValue_Array // *JsonValue_String_ // *JsonValue_Number // *JsonValue_Bool - Kind isJsonValue_Kind `protobuf_oneof:"kind"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + Kind isJsonValue_Kind `protobuf_oneof:"kind"` } func (x *JsonValue) Reset() { *x = JsonValue{} - mi := &file_jsonl_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_jsonl_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *JsonValue) String() string { @@ -94,7 +99,7 @@ func (*JsonValue) ProtoMessage() {} func (x *JsonValue) ProtoReflect() protoreflect.Message { mi := &file_jsonl_proto_msgTypes[1] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -109,54 +114,44 @@ func (*JsonValue) Descriptor() ([]byte, []int) { return file_jsonl_proto_rawDescGZIP(), []int{1} } -func (x *JsonValue) GetKind() isJsonValue_Kind { - if x != nil { - return x.Kind +func (m *JsonValue) GetKind() isJsonValue_Kind { + if m != nil { + return m.Kind } return nil } func (x *JsonValue) GetObject() *JsonObject { - if x != nil { - if x, ok := x.Kind.(*JsonValue_Object); ok { - return x.Object - } + if x, ok := x.GetKind().(*JsonValue_Object); ok { + return x.Object } return nil } func (x *JsonValue) GetArray() *JsonArray { - if x != nil { - if x, ok := x.Kind.(*JsonValue_Array); ok { - return x.Array - } + if x, ok := x.GetKind().(*JsonValue_Array); ok { + return x.Array } return nil } func (x *JsonValue) GetString_() string { - if x != nil { - if x, ok := x.Kind.(*JsonValue_String_); ok { - return x.String_ - } + if x, ok := x.GetKind().(*JsonValue_String_); ok { + return x.String_ } return "" } func (x *JsonValue) GetNumber() float64 { - if x != nil { - if x, ok := x.Kind.(*JsonValue_Number); ok { - return x.Number - } + if x, ok := x.GetKind().(*JsonValue_Number); ok { + return x.Number } return 0 } func (x *JsonValue) GetBool() bool { - if x != nil { - if x, ok := x.Kind.(*JsonValue_Bool); ok { - return x.Bool - } + if x, ok := x.GetKind().(*JsonValue_Bool); ok { + return x.Bool } return false } @@ -196,17 +191,20 @@ func (*JsonValue_Number) isJsonValue_Kind() {} func (*JsonValue_Bool) isJsonValue_Kind() {} type JsonObject struct { - state protoimpl.MessageState `protogen:"open.v1"` - Elems []*JsonObjectElem `protobuf:"bytes,1,rep,name=elems,proto3" json:"elems,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elems []*JsonObjectElem `protobuf:"bytes,1,rep,name=elems,proto3" json:"elems,omitempty"` } func (x *JsonObject) Reset() { *x = JsonObject{} - mi := &file_jsonl_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_jsonl_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *JsonObject) String() string { @@ -217,7 +215,7 @@ func (*JsonObject) ProtoMessage() {} func (x *JsonObject) ProtoReflect() protoreflect.Message { mi := &file_jsonl_proto_msgTypes[2] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -240,18 +238,21 @@ func (x *JsonObject) GetElems() []*JsonObjectElem { } type JsonObjectElem struct { - state protoimpl.MessageState `protogen:"open.v1"` - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value *JsonValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value *JsonValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *JsonObjectElem) Reset() { *x = JsonObjectElem{} - mi := &file_jsonl_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_jsonl_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *JsonObjectElem) String() string { @@ -262,7 +263,7 @@ func (*JsonObjectElem) ProtoMessage() {} func (x *JsonObjectElem) ProtoReflect() protoreflect.Message { mi := &file_jsonl_proto_msgTypes[3] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -293,17 +294,20 @@ func (x *JsonObjectElem) GetValue() *JsonValue { // Array of JsonValue type JsonArray struct { - state protoimpl.MessageState `protogen:"open.v1"` - Values []*JsonValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - unknownFields protoimpl.UnknownFields + state protoimpl.MessageState sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Values []*JsonValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` } func (x *JsonArray) Reset() { *x = JsonArray{} - mi := &file_jsonl_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_jsonl_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *JsonArray) String() string { @@ -314,7 +318,7 @@ func (*JsonArray) ProtoMessage() {} func (x *JsonArray) ProtoReflect() protoreflect.Message { mi := &file_jsonl_proto_msgTypes[4] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -338,41 +342,56 @@ func (x *JsonArray) GetValues() []*JsonValue { var File_jsonl_proto protoreflect.FileDescriptor -const file_jsonl_proto_rawDesc = "" + - "\n" + - "\vjsonl.proto\x12\x06jsonpb\"1\n" + - "\x06Record\x12'\n" + - "\x05value\x18\x01 \x01(\v2\x11.jsonpb.JsonValueR\x05value\"\xb6\x01\n" + - "\tJsonValue\x12,\n" + - "\x06object\x18\x01 \x01(\v2\x12.jsonpb.JsonObjectH\x00R\x06object\x12)\n" + - "\x05array\x18\x02 \x01(\v2\x11.jsonpb.JsonArrayH\x00R\x05array\x12\x18\n" + - "\x06string\x18\x03 \x01(\tH\x00R\x06string\x12\x18\n" + - "\x06number\x18\x04 \x01(\x01H\x00R\x06number\x12\x14\n" + - "\x04bool\x18\x05 \x01(\bH\x00R\x04boolB\x06\n" + - "\x04kind\":\n" + - "\n" + - "JsonObject\x12,\n" + - "\x05elems\x18\x01 \x03(\v2\x16.jsonpb.JsonObjectElemR\x05elems\"K\n" + - "\x0eJsonObjectElem\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12'\n" + - "\x05value\x18\x02 \x01(\v2\x11.jsonpb.JsonValueR\x05value\"6\n" + - "\tJsonArray\x12)\n" + - "\x06values\x18\x01 \x03(\v2\x11.jsonpb.JsonValueR\x06valuesB7Z5github.com/splunk/stef/examples/jsonl/internal/jsonpbb\x06proto3" +var file_jsonl_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x6a, + 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x22, 0x31, 0x0a, 0x06, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, + 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xb6, 0x01, 0x0a, 0x09, 0x4a, 0x73, 0x6f, + 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2e, + 0x4a, 0x73, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x06, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x12, 0x29, 0x0a, 0x05, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4a, 0x73, 0x6f, + 0x6e, 0x41, 0x72, 0x72, 0x61, 0x79, 0x48, 0x00, 0x52, 0x05, 0x61, 0x72, 0x72, 0x61, 0x79, 0x12, + 0x18, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x0a, 0x06, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x06, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x08, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x22, 0x3a, 0x0a, 0x0a, 0x4a, 0x73, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, + 0x2c, 0x0a, 0x05, 0x65, 0x6c, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x52, 0x05, 0x65, 0x6c, 0x65, 0x6d, 0x73, 0x22, 0x4b, 0x0a, + 0x0e, 0x4a, 0x73, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x36, 0x0a, 0x09, 0x4a, 0x73, + 0x6f, 0x6e, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x29, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, + 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x73, 0x70, 0x6c, 0x75, 0x6e, 0x6b, 0x2f, 0x73, 0x74, 0x65, 0x66, 0x2f, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} var ( file_jsonl_proto_rawDescOnce sync.Once - file_jsonl_proto_rawDescData []byte + file_jsonl_proto_rawDescData = file_jsonl_proto_rawDesc ) func file_jsonl_proto_rawDescGZIP() []byte { file_jsonl_proto_rawDescOnce.Do(func() { - file_jsonl_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_jsonl_proto_rawDesc), len(file_jsonl_proto_rawDesc))) + file_jsonl_proto_rawDescData = protoimpl.X.CompressGZIP(file_jsonl_proto_rawDescData) }) return file_jsonl_proto_rawDescData } var file_jsonl_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_jsonl_proto_goTypes = []any{ +var file_jsonl_proto_goTypes = []interface{}{ (*Record)(nil), // 0: jsonpb.Record (*JsonValue)(nil), // 1: jsonpb.JsonValue (*JsonObject)(nil), // 2: jsonpb.JsonObject @@ -398,7 +417,69 @@ func file_jsonl_proto_init() { if File_jsonl_proto != nil { return } - file_jsonl_proto_msgTypes[1].OneofWrappers = []any{ + if !protoimpl.UnsafeEnabled { + file_jsonl_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Record); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_jsonl_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JsonValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_jsonl_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JsonObject); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_jsonl_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JsonObjectElem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_jsonl_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JsonArray); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_jsonl_proto_msgTypes[1].OneofWrappers = []interface{}{ (*JsonValue_Object)(nil), (*JsonValue_Array)(nil), (*JsonValue_String_)(nil), @@ -409,7 +490,7 @@ func file_jsonl_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_jsonl_proto_rawDesc), len(file_jsonl_proto_rawDesc)), + RawDescriptor: file_jsonl_proto_rawDesc, NumEnums: 0, NumMessages: 5, NumExtensions: 0, @@ -420,6 +501,7 @@ func file_jsonl_proto_init() { MessageInfos: file_jsonl_proto_msgTypes, }.Build() File_jsonl_proto = out.File + file_jsonl_proto_rawDesc = nil file_jsonl_proto_goTypes = nil file_jsonl_proto_depIdxs = nil -} +} \ No newline at end of file diff --git a/go/grpc/stef_proto/destination.pb.go b/go/grpc/stef_proto/destination.pb.go index a53963c8..afa160a3 100644 --- a/go/grpc/stef_proto/destination.pb.go +++ b/go/grpc/stef_proto/destination.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.26.0 // protoc v5.29.5 // source: destination.proto @@ -11,7 +11,6 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" - unsafe "unsafe" ) const ( @@ -22,7 +21,10 @@ const ( ) type STEFClientMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The client MUST set first_message field in the first STEFClientMessage sent. // All other fields MUST be unset when first_message is set. // All subsequent messages MUST have first_message unset. @@ -38,16 +40,16 @@ type STEFClientMessage struct { // the chunk is encountered and only then start decoding the chunk. // Clients MUST ensure they mark this field true at least once in a while otherwise // recipients may never start decoding the data. - IsEndOfChunk bool `protobuf:"varint,3,opt,name=is_end_of_chunk,json=isEndOfChunk,proto3" json:"is_end_of_chunk,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + IsEndOfChunk bool `protobuf:"varint,3,opt,name=is_end_of_chunk,json=isEndOfChunk,proto3" json:"is_end_of_chunk,omitempty"` } func (x *STEFClientMessage) Reset() { *x = STEFClientMessage{} - mi := &file_destination_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_destination_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *STEFClientMessage) String() string { @@ -58,7 +60,7 @@ func (*STEFClientMessage) ProtoMessage() {} func (x *STEFClientMessage) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[0] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -101,21 +103,24 @@ func (x *STEFClientMessage) GetIsEndOfChunk() bool { // destination. The client MUST NOT send STEF data until it receives // STEFDestinationCapabilities message from the destination. type STEFClientFirstMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // The name of the root struct of the client's schema. This is useful // for destinations that accept multiple schemas and need to know which schema // the client is using. The destination will use this information to // determine the schema to use for decoding the data. RootStructName string `protobuf:"bytes,1,opt,name=root_struct_name,json=rootStructName,proto3" json:"root_struct_name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache } func (x *STEFClientFirstMessage) Reset() { *x = STEFClientFirstMessage{} - mi := &file_destination_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_destination_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *STEFClientFirstMessage) String() string { @@ -126,7 +131,7 @@ func (*STEFClientFirstMessage) ProtoMessage() {} func (x *STEFClientFirstMessage) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[1] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -149,7 +154,10 @@ func (x *STEFClientFirstMessage) GetRootStructName() string { } type STEFDestinationCapabilities struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // dictionary_limits of the destination. The client MUST honor the limits. DictionaryLimits *STEFDictionaryLimits `protobuf:"bytes,1,opt,name=dictionary_limits,json=dictionaryLimits,proto3" json:"dictionary_limits,omitempty"` // schema is the STEF schema supported by the destination. The schema description @@ -166,16 +174,16 @@ type STEFDestinationCapabilities struct { // 4. The schema is incompatible with client's schema (neither an exact match, nor a // subset or superset). The client and the destination are incompatible and cannot // communicate. The client MUST close the stream, further communication is not possible. - Schema []byte `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + Schema []byte `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` } func (x *STEFDestinationCapabilities) Reset() { *x = STEFDestinationCapabilities{} - mi := &file_destination_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_destination_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *STEFDestinationCapabilities) String() string { @@ -186,7 +194,7 @@ func (*STEFDestinationCapabilities) ProtoMessage() {} func (x *STEFDestinationCapabilities) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[2] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -219,7 +227,10 @@ func (x *STEFDestinationCapabilities) GetSchema() []byte { // are reached the sender will reset the dictionaries. This prevents the // dictionaries growing indefinitely large. type STEFDictionaryLimits struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Maximum total in-memory byte size of all dictionaries. // 0 means no limit. // The sender's total byte size calculation may be approximate. Senders @@ -229,16 +240,16 @@ type STEFDictionaryLimits struct { // the sender computes and what receiver's re-created dictionary ends up using. // Receivers that are memory constrained should specify conservatively low values // for the limit. - MaxDictBytes uint64 `protobuf:"varint,2,opt,name=max_dict_bytes,json=maxDictBytes,proto3" json:"max_dict_bytes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + MaxDictBytes uint64 `protobuf:"varint,2,opt,name=max_dict_bytes,json=maxDictBytes,proto3" json:"max_dict_bytes,omitempty"` } func (x *STEFDictionaryLimits) Reset() { *x = STEFDictionaryLimits{} - mi := &file_destination_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_destination_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *STEFDictionaryLimits) String() string { @@ -249,7 +260,7 @@ func (*STEFDictionaryLimits) ProtoMessage() {} func (x *STEFDictionaryLimits) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[3] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -272,24 +283,27 @@ func (x *STEFDictionaryLimits) GetMaxDictBytes() uint64 { } type STEFServerMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // TODO: refactor this to avoid using oneof message to reduce // allocations for the most common case of STEFDataResponse. // - // Types that are valid to be assigned to Message: + // Types that are assignable to Message: // // *STEFServerMessage_Capabilities // *STEFServerMessage_Response - Message isSTEFServerMessage_Message `protobuf_oneof:"message"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + Message isSTEFServerMessage_Message `protobuf_oneof:"message"` } func (x *STEFServerMessage) Reset() { *x = STEFServerMessage{} - mi := &file_destination_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_destination_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *STEFServerMessage) String() string { @@ -300,7 +314,7 @@ func (*STEFServerMessage) ProtoMessage() {} func (x *STEFServerMessage) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[4] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -315,27 +329,23 @@ func (*STEFServerMessage) Descriptor() ([]byte, []int) { return file_destination_proto_rawDescGZIP(), []int{4} } -func (x *STEFServerMessage) GetMessage() isSTEFServerMessage_Message { - if x != nil { - return x.Message +func (m *STEFServerMessage) GetMessage() isSTEFServerMessage_Message { + if m != nil { + return m.Message } return nil } func (x *STEFServerMessage) GetCapabilities() *STEFDestinationCapabilities { - if x != nil { - if x, ok := x.Message.(*STEFServerMessage_Capabilities); ok { - return x.Capabilities - } + if x, ok := x.GetMessage().(*STEFServerMessage_Capabilities); ok { + return x.Capabilities } return nil } func (x *STEFServerMessage) GetResponse() *STEFDataResponse { - if x != nil { - if x, ok := x.Message.(*STEFServerMessage_Response); ok { - return x.Response - } + if x, ok := x.GetMessage().(*STEFServerMessage_Response); ok { + return x.Response } return nil } @@ -357,7 +367,10 @@ func (*STEFServerMessage_Capabilities) isSTEFServerMessage_Message() {} func (*STEFServerMessage_Response) isSTEFServerMessage_Message() {} type STEFDataResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // ack_record_id acknowledges receipt of STEF data // with record_id <= ack_record_id. // @@ -375,15 +388,15 @@ type STEFDataResponse struct { // This field is optional. When empty it means there is no bad data, // all data up to ack_record_id was successfully processed. BadDataRecordIdRanges []*STEFIDRange `protobuf:"bytes,2,rep,name=bad_data_record_id_ranges,json=badDataRecordIdRanges,proto3" json:"bad_data_record_id_ranges,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache } func (x *STEFDataResponse) Reset() { *x = STEFDataResponse{} - mi := &file_destination_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_destination_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *STEFDataResponse) String() string { @@ -394,7 +407,7 @@ func (*STEFDataResponse) ProtoMessage() {} func (x *STEFDataResponse) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[5] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -424,20 +437,23 @@ func (x *STEFDataResponse) GetBadDataRecordIdRanges() []*STEFIDRange { } type STEFIDRange struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // From ID, inclusive. FromId uint64 `protobuf:"varint,1,opt,name=from_id,json=fromId,proto3" json:"from_id,omitempty"` // To ID, inclusive. - ToId uint64 `protobuf:"varint,2,opt,name=to_id,json=toId,proto3" json:"to_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + ToId uint64 `protobuf:"varint,2,opt,name=to_id,json=toId,proto3" json:"to_id,omitempty"` } func (x *STEFIDRange) Reset() { *x = STEFIDRange{} - mi := &file_destination_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_destination_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *STEFIDRange) String() string { @@ -448,7 +464,7 @@ func (*STEFIDRange) ProtoMessage() {} func (x *STEFIDRange) ProtoReflect() protoreflect.Message { mi := &file_destination_proto_msgTypes[6] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -479,49 +495,80 @@ func (x *STEFIDRange) GetToId() uint64 { var File_destination_proto protoreflect.FileDescriptor -const file_destination_proto_rawDesc = "" + - "\n" + - "\x11destination.proto\"\x97\x01\n" + - "\x11STEFClientMessage\x12<\n" + - "\rfirst_message\x18\x01 \x01(\v2\x17.STEFClientFirstMessageR\ffirstMessage\x12\x1d\n" + - "\n" + - "stef_bytes\x18\x02 \x01(\fR\tstefBytes\x12%\n" + - "\x0fis_end_of_chunk\x18\x03 \x01(\bR\fisEndOfChunk\"B\n" + - "\x16STEFClientFirstMessage\x12(\n" + - "\x10root_struct_name\x18\x01 \x01(\tR\x0erootStructName\"y\n" + - "\x1bSTEFDestinationCapabilities\x12B\n" + - "\x11dictionary_limits\x18\x01 \x01(\v2\x15.STEFDictionaryLimitsR\x10dictionaryLimits\x12\x16\n" + - "\x06schema\x18\x02 \x01(\fR\x06schema\"<\n" + - "\x14STEFDictionaryLimits\x12$\n" + - "\x0emax_dict_bytes\x18\x02 \x01(\x04R\fmaxDictBytes\"\x93\x01\n" + - "\x11STEFServerMessage\x12B\n" + - "\fcapabilities\x18\x01 \x01(\v2\x1c.STEFDestinationCapabilitiesH\x00R\fcapabilities\x12/\n" + - "\bresponse\x18\x02 \x01(\v2\x11.STEFDataResponseH\x00R\bresponseB\t\n" + - "\amessage\"~\n" + - "\x10STEFDataResponse\x12\"\n" + - "\rack_record_id\x18\x01 \x01(\x04R\vackRecordId\x12F\n" + - "\x19bad_data_record_id_ranges\x18\x02 \x03(\v2\f.STEFIDRangeR\x15badDataRecordIdRanges\";\n" + - "\vSTEFIDRange\x12\x17\n" + - "\afrom_id\x18\x01 \x01(\x04R\x06fromId\x12\x13\n" + - "\x05to_id\x18\x02 \x01(\x04R\x04toId2I\n" + - "\x0fSTEFDestination\x126\n" + - "\x06Stream\x12\x12.STEFClientMessage\x1a\x12.STEFServerMessage\"\x00(\x010\x01B2\n" + - "!net.stef.grpc.service.destinationP\x01Z\v/stef_protob\x06proto3" +var file_destination_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x01, 0x0a, 0x11, 0x53, 0x54, 0x45, 0x46, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x0d, 0x66, 0x69, 0x72, + 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x53, 0x54, 0x45, 0x46, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x72, + 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0c, 0x66, 0x69, 0x72, 0x73, 0x74, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x65, 0x66, 0x5f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x65, + 0x66, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0f, 0x69, 0x73, 0x5f, 0x65, 0x6e, 0x64, + 0x5f, 0x6f, 0x66, 0x5f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0c, 0x69, 0x73, 0x45, 0x6e, 0x64, 0x4f, 0x66, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0x42, 0x0a, + 0x16, 0x53, 0x54, 0x45, 0x46, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x72, 0x73, 0x74, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x72, 0x6f, 0x6f, 0x74, 0x5f, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x72, 0x6f, 0x6f, 0x74, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0x79, 0x0a, 0x1b, 0x53, 0x54, 0x45, 0x46, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x12, 0x42, 0x0a, 0x11, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x53, 0x54, + 0x45, 0x46, 0x44, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x73, 0x52, 0x10, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x3c, 0x0a, 0x14, + 0x53, 0x54, 0x45, 0x46, 0x44, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x69, 0x63, 0x74, + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6d, 0x61, + 0x78, 0x44, 0x69, 0x63, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x93, 0x01, 0x0a, 0x11, 0x53, + 0x54, 0x45, 0x46, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x42, 0x0a, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x53, 0x54, 0x45, 0x46, 0x44, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x69, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x69, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x53, 0x54, 0x45, 0x46, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x22, 0x7e, 0x0a, 0x10, 0x53, 0x54, 0x45, 0x46, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x63, 0x6b, 0x5f, 0x72, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x61, 0x63, 0x6b, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x19, 0x62, 0x61, 0x64, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x5f, 0x72, + 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x53, 0x54, + 0x45, 0x46, 0x49, 0x44, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x15, 0x62, 0x61, 0x64, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x22, 0x3b, 0x0a, 0x0b, 0x53, 0x54, 0x45, 0x46, 0x49, 0x44, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x06, 0x66, 0x72, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x6f, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, 0x6f, 0x49, 0x64, 0x32, 0x49, 0x0a, + 0x0f, 0x53, 0x54, 0x45, 0x46, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x36, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x12, 0x2e, 0x53, 0x54, 0x45, + 0x46, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x12, + 0x2e, 0x53, 0x54, 0x45, 0x46, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x32, 0x0a, 0x21, 0x6e, 0x65, 0x74, 0x2e, + 0x73, 0x74, 0x65, 0x66, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x01, 0x5a, + 0x0b, 0x2f, 0x73, 0x74, 0x65, 0x66, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} var ( file_destination_proto_rawDescOnce sync.Once - file_destination_proto_rawDescData []byte + file_destination_proto_rawDescData = file_destination_proto_rawDesc ) func file_destination_proto_rawDescGZIP() []byte { file_destination_proto_rawDescOnce.Do(func() { - file_destination_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_destination_proto_rawDesc), len(file_destination_proto_rawDesc))) + file_destination_proto_rawDescData = protoimpl.X.CompressGZIP(file_destination_proto_rawDescData) }) return file_destination_proto_rawDescData } var file_destination_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_destination_proto_goTypes = []any{ +var file_destination_proto_goTypes = []interface{}{ (*STEFClientMessage)(nil), // 0: STEFClientMessage (*STEFClientFirstMessage)(nil), // 1: STEFClientFirstMessage (*STEFDestinationCapabilities)(nil), // 2: STEFDestinationCapabilities @@ -550,7 +597,93 @@ func file_destination_proto_init() { if File_destination_proto != nil { return } - file_destination_proto_msgTypes[4].OneofWrappers = []any{ + if !protoimpl.UnsafeEnabled { + file_destination_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*STEFClientMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_destination_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*STEFClientFirstMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_destination_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*STEFDestinationCapabilities); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_destination_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*STEFDictionaryLimits); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_destination_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*STEFServerMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_destination_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*STEFDataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_destination_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*STEFIDRange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_destination_proto_msgTypes[4].OneofWrappers = []interface{}{ (*STEFServerMessage_Capabilities)(nil), (*STEFServerMessage_Response)(nil), } @@ -558,7 +691,7 @@ func file_destination_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_destination_proto_rawDesc), len(file_destination_proto_rawDesc)), + RawDescriptor: file_destination_proto_rawDesc, NumEnums: 0, NumMessages: 7, NumExtensions: 0, @@ -569,6 +702,7 @@ func file_destination_proto_init() { MessageInfos: file_destination_proto_msgTypes, }.Build() File_destination_proto = out.File + file_destination_proto_rawDesc = nil file_destination_proto_goTypes = nil file_destination_proto_depIdxs = nil -} +} \ No newline at end of file diff --git a/go/grpc/stef_proto/destination_grpc.pb.go b/go/grpc/stef_proto/destination_grpc.pb.go index bd234d35..4496eee0 100644 --- a/go/grpc/stef_proto/destination_grpc.pb.go +++ b/go/grpc/stef_proto/destination_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.6.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v5.29.5 // source: destination.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 const ( STEFDestination_Stream_FullMethodName = "/STEFDestination/Stream" @@ -25,8 +25,6 @@ const ( // STEFDestinationClient is the client API for STEFDestination service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Destination is a service to which STEF data can be sent. type STEFDestinationClient interface { // Stream is a channel to send STEF data from the client to Destination. // Once the stream is open the Destination MUST send a ServerMessage with @@ -36,7 +34,7 @@ type STEFDestinationClient interface { // ClientMessage containing STEF data. The Destination MUST periodically // respond with ServerMessage containing ExportResponse field. // One gRPC stream corresponds to one STEF byte stream. - Stream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[STEFClientMessage, STEFServerMessage], error) + Stream(ctx context.Context, opts ...grpc.CallOption) (STEFDestination_StreamClient, error) } type sTEFDestinationClient struct { @@ -47,24 +45,40 @@ func NewSTEFDestinationClient(cc grpc.ClientConnInterface) STEFDestinationClient return &sTEFDestinationClient{cc} } -func (c *sTEFDestinationClient) Stream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[STEFClientMessage, STEFServerMessage], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &STEFDestination_ServiceDesc.Streams[0], STEFDestination_Stream_FullMethodName, cOpts...) +func (c *sTEFDestinationClient) Stream(ctx context.Context, opts ...grpc.CallOption) (STEFDestination_StreamClient, error) { + stream, err := c.cc.NewStream(ctx, &STEFDestination_ServiceDesc.Streams[0], STEFDestination_Stream_FullMethodName, opts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[STEFClientMessage, STEFServerMessage]{ClientStream: stream} + x := &sTEFDestinationStreamClient{stream} return x, nil } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type STEFDestination_StreamClient = grpc.BidiStreamingClient[STEFClientMessage, STEFServerMessage] +type STEFDestination_StreamClient interface { + Send(*STEFClientMessage) error + Recv() (*STEFServerMessage, error) + grpc.ClientStream +} + +type sTEFDestinationStreamClient struct { + grpc.ClientStream +} + +func (x *sTEFDestinationStreamClient) Send(m *STEFClientMessage) error { + return x.ClientStream.SendMsg(m) +} + +func (x *sTEFDestinationStreamClient) Recv() (*STEFServerMessage, error) { + m := new(STEFServerMessage) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} // STEFDestinationServer is the server API for STEFDestination service. // All implementations must embed UnimplementedSTEFDestinationServer -// for forward compatibility. -// -// Destination is a service to which STEF data can be sent. +// for forward compatibility type STEFDestinationServer interface { // Stream is a channel to send STEF data from the client to Destination. // Once the stream is open the Destination MUST send a ServerMessage with @@ -74,22 +88,18 @@ type STEFDestinationServer interface { // ClientMessage containing STEF data. The Destination MUST periodically // respond with ServerMessage containing ExportResponse field. // One gRPC stream corresponds to one STEF byte stream. - Stream(grpc.BidiStreamingServer[STEFClientMessage, STEFServerMessage]) error + Stream(STEFDestination_StreamServer) error mustEmbedUnimplementedSTEFDestinationServer() } -// UnimplementedSTEFDestinationServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedSTEFDestinationServer struct{} +// UnimplementedSTEFDestinationServer must be embedded to have forward compatible implementations. +type UnimplementedSTEFDestinationServer struct { +} -func (UnimplementedSTEFDestinationServer) Stream(grpc.BidiStreamingServer[STEFClientMessage, STEFServerMessage]) error { - return status.Error(codes.Unimplemented, "method Stream not implemented") +func (UnimplementedSTEFDestinationServer) Stream(STEFDestination_StreamServer) error { + return status.Errorf(codes.Unimplemented, "method Stream not implemented") } func (UnimplementedSTEFDestinationServer) mustEmbedUnimplementedSTEFDestinationServer() {} -func (UnimplementedSTEFDestinationServer) testEmbeddedByValue() {} // UnsafeSTEFDestinationServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to STEFDestinationServer will @@ -99,22 +109,34 @@ type UnsafeSTEFDestinationServer interface { } func RegisterSTEFDestinationServer(s grpc.ServiceRegistrar, srv STEFDestinationServer) { - // If the following call panics, it indicates UnimplementedSTEFDestinationServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&STEFDestination_ServiceDesc, srv) } func _STEFDestination_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(STEFDestinationServer).Stream(&grpc.GenericServerStream[STEFClientMessage, STEFServerMessage]{ServerStream: stream}) + return srv.(STEFDestinationServer).Stream(&sTEFDestinationStreamServer{stream}) +} + +type STEFDestination_StreamServer interface { + Send(*STEFServerMessage) error + Recv() (*STEFClientMessage, error) + grpc.ServerStream +} + +type sTEFDestinationStreamServer struct { + grpc.ServerStream } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type STEFDestination_StreamServer = grpc.BidiStreamingServer[STEFClientMessage, STEFServerMessage] +func (x *sTEFDestinationStreamServer) Send(m *STEFServerMessage) error { + return x.ServerStream.SendMsg(m) +} + +func (x *sTEFDestinationStreamServer) Recv() (*STEFClientMessage, error) { + m := new(STEFClientMessage) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} // STEFDestination_ServiceDesc is the grpc.ServiceDesc for STEFDestination service. // It's only intended for direct use with grpc.RegisterService, @@ -132,4 +154,4 @@ var STEFDestination_ServiceDesc = grpc.ServiceDesc{ }, }, Metadata: "destination.proto", -} +} \ No newline at end of file From e95c256d8bdbe401a55deee978d124ff6ac20a85 Mon Sep 17 00:00:00 2001 From: Abhishek Chatterjee Date: Mon, 22 Dec 2025 22:56:55 +0530 Subject: [PATCH 7/7] Regenerated the files after reverting the changes with protoc version v5.29.5 --- examples/jsonl/internal/jsonpb/jsonl.pb.go | 2 +- go/grpc/stef_proto/destination.pb.go | 2 +- go/grpc/stef_proto/destination_grpc.pb.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/jsonl/internal/jsonpb/jsonl.pb.go b/examples/jsonl/internal/jsonpb/jsonl.pb.go index ece7d8a0..62c18e94 100644 --- a/examples/jsonl/internal/jsonpb/jsonl.pb.go +++ b/examples/jsonl/internal/jsonpb/jsonl.pb.go @@ -504,4 +504,4 @@ func file_jsonl_proto_init() { file_jsonl_proto_rawDesc = nil file_jsonl_proto_goTypes = nil file_jsonl_proto_depIdxs = nil -} \ No newline at end of file +} diff --git a/go/grpc/stef_proto/destination.pb.go b/go/grpc/stef_proto/destination.pb.go index afa160a3..b8e97168 100644 --- a/go/grpc/stef_proto/destination.pb.go +++ b/go/grpc/stef_proto/destination.pb.go @@ -705,4 +705,4 @@ func file_destination_proto_init() { file_destination_proto_rawDesc = nil file_destination_proto_goTypes = nil file_destination_proto_depIdxs = nil -} \ No newline at end of file +} diff --git a/go/grpc/stef_proto/destination_grpc.pb.go b/go/grpc/stef_proto/destination_grpc.pb.go index 4496eee0..d292913d 100644 --- a/go/grpc/stef_proto/destination_grpc.pb.go +++ b/go/grpc/stef_proto/destination_grpc.pb.go @@ -154,4 +154,4 @@ var STEFDestination_ServiceDesc = grpc.ServiceDesc{ }, }, Metadata: "destination.proto", -} \ No newline at end of file +}