diff --git a/pkg/dataobj/internal/metadata/logsmd/logsmd.pb.go b/pkg/dataobj/internal/metadata/logsmd/logsmd.pb.go index f02d6b50e0..4ebdd356a5 100644 --- a/pkg/dataobj/internal/metadata/logsmd/logsmd.pb.go +++ b/pkg/dataobj/internal/metadata/logsmd/logsmd.pb.go @@ -71,6 +71,8 @@ type Metadata struct { Columns []*ColumnDesc `protobuf:"bytes,1,rep,name=columns,proto3" json:"columns,omitempty"` // Section sort information. SortInfo *datasetmd.SectionSortInfo `protobuf:"bytes,2,opt,name=sort_info,json=sortInfo,proto3" json:"sort_info,omitempty"` + // The tenant who owns the streams section. + Tenant string `protobuf:"bytes,3,opt,name=tenant,proto3" json:"tenant,omitempty"` } func (m *Metadata) Reset() { *m = Metadata{} } @@ -119,6 +121,13 @@ func (m *Metadata) GetSortInfo() *datasetmd.SectionSortInfo { return nil } +func (m *Metadata) GetTenant() string { + if m != nil { + return m.Tenant + } + return "" +} + // ColumnDesc describes an individual column within the logs table. type ColumnDesc struct { // Information about the column. @@ -276,36 +285,37 @@ func init() { } var fileDescriptor_50d9821968c7172c = []byte{ - // 466 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x2c, 0xc8, 0x4e, 0xd7, - 0x4f, 0x49, 0x2c, 0x49, 0xcc, 0x4f, 0xca, 0xd2, 0xcf, 0xcc, 0x2b, 0x49, 0x2d, 0xca, 0x4b, 0xcc, - 0xd1, 0xcf, 0x4d, 0x2d, 0x49, 0x04, 0x09, 0xea, 0xe7, 0xe4, 0xa7, 0x17, 0xe7, 0xa6, 0x40, 0x29, - 0xbd, 0x82, 0xa2, 0xfc, 0x92, 0x7c, 0x21, 0x09, 0xa8, 0x72, 0x3d, 0x98, 0x2a, 0x3d, 0x90, 0xb4, - 0x5e, 0x99, 0xa1, 0x94, 0x39, 0x7e, 0xc3, 0x40, 0x44, 0x71, 0x6a, 0x49, 0x6e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0x80, 0x34, 0x21, 0x3c, 0xa3, 0x35, 0x09, 0x1e, 0x30, 0x20, 0x77, 0x0a, - 0x49, 0x73, 0x89, 0x3b, 0xfb, 0xfb, 0x84, 0xfa, 0xfa, 0xc5, 0x87, 0x44, 0x06, 0xb8, 0xc6, 0x87, - 0xfa, 0x05, 0x07, 0xb8, 0x3a, 0x7b, 0xba, 0x79, 0xba, 0xba, 0x08, 0x30, 0x08, 0x49, 0x72, 0x89, - 0x22, 0x4b, 0x06, 0x87, 0x04, 0xb9, 0x3a, 0xfa, 0xc6, 0x7b, 0xba, 0x08, 0x30, 0xa2, 0x4b, 0x85, - 0x78, 0xfa, 0xba, 0x06, 0x87, 0x38, 0xfa, 0x06, 0x08, 0x30, 0x09, 0x49, 0x70, 0x89, 0x20, 0x4b, - 0xf9, 0xba, 0x86, 0x38, 0xba, 0x38, 0x86, 0x38, 0x0a, 0x30, 0x0b, 0x89, 0x73, 0x09, 0xa3, 0xca, - 0x04, 0x07, 0x3b, 0xba, 0xbb, 0x0a, 0xb0, 0x38, 0x95, 0x5e, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, - 0x1c, 0xc3, 0x87, 0x87, 0x72, 0x8c, 0x0d, 0x8f, 0xe4, 0x18, 0x57, 0x3c, 0x92, 0x63, 0x3c, 0xf1, - 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x5f, 0x3c, 0x92, 0x63, 0xf8, - 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, - 0x88, 0xb2, 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0x2f, 0x4a, - 0x4c, 0x4b, 0xcc, 0x03, 0x25, 0xfb, 0xec, 0x4c, 0xfd, 0x32, 0x63, 0x7d, 0x62, 0x32, 0x47, 0x12, - 0x1b, 0x38, 0x0d, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x6a, 0xbf, 0x6e, 0xb4, 0x4b, 0x03, + // 482 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x6e, 0xd3, 0x40, + 0x18, 0xf4, 0x36, 0xa1, 0xa4, 0x5b, 0xa9, 0xb2, 0x96, 0x9f, 0x1a, 0x90, 0x56, 0x91, 0x05, 0x22, + 0x42, 0xc8, 0x56, 0xdb, 0x03, 0x45, 0x48, 0x20, 0x93, 0x18, 0x64, 0x84, 0x4b, 0x64, 0xbb, 0x07, + 0xb8, 0x44, 0x9b, 0x64, 0x63, 0x4c, 0xe3, 0x5d, 0xcb, 0xde, 0x54, 0xea, 0x0d, 0x89, 0x17, 0x40, + 0x3c, 0x05, 0x17, 0xde, 0x83, 0x63, 0x8e, 0x3d, 0x12, 0xe7, 0xc2, 0xb1, 0x8f, 0x80, 0xbc, 0x71, + 0x9a, 0x16, 0x94, 0xd0, 0x8b, 0xbd, 0xfe, 0xe6, 0x9b, 0x99, 0xef, 0x1b, 0x79, 0xe1, 0x4e, 0x72, + 0x14, 0x9a, 0x7d, 0x22, 0x08, 0xef, 0x7e, 0x32, 0x23, 0x26, 0x68, 0xca, 0xc8, 0xd0, 0x8c, 0xa9, + 0x20, 0x45, 0xd1, 0x1c, 0xf2, 0x30, 0x8b, 0xfb, 0xe5, 0xcb, 0x48, 0x52, 0x2e, 0x38, 0xd2, 0xca, + 0x76, 0x63, 0xde, 0x65, 0x14, 0xb0, 0x71, 0xbc, 0x73, 0xf7, 0xc9, 0x6a, 0xb1, 0xe2, 0x91, 0x51, + 0x11, 0xf7, 0x17, 0xa7, 0x99, 0xa4, 0xfe, 0x03, 0xc0, 0x9a, 0x5b, 0xb6, 0xa1, 0xe7, 0xf0, 0x7a, + 0x8f, 0x0f,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2d, 0x55, 0x41, 0x77, 0xe0, 0xad, 0x8b, 0xa0, + 0x1f, 0x78, 0xb6, 0xe5, 0x76, 0x9c, 0x96, 0x0a, 0xfe, 0x86, 0x02, 0xc7, 0xb5, 0xfd, 0xc0, 0x72, + 0xdb, 0xea, 0x1a, 0xd2, 0xe0, 0xcd, 0x8b, 0x90, 0x6b, 0x07, 0x56, 0xcb, 0x0a, 0x2c, 0xb5, 0x82, + 0xb6, 0xe1, 0x8d, 0xcb, 0x88, 0xef, 0x5b, 0xaf, 0x6d, 0xb5, 0xfa, 0x72, 0x34, 0x9e, 0x60, 0xe5, + 0x74, 0x82, 0x95, 0xb3, 0x09, 0x06, 0x9f, 0x73, 0x0c, 0xbe, 0xe7, 0x18, 0xfc, 0xcc, 0x31, 0x18, + 0xe7, 0x18, 0xfc, 0xca, 0x31, 0xf8, 0x9d, 0x63, 0xe5, 0x2c, 0xc7, 0xe0, 0xeb, 0x14, 0x2b, 0xe3, + 0x29, 0x56, 0x4e, 0xa7, 0x58, 0xf9, 0xf0, 0x22, 0x8c, 0xc4, 0xc7, 0x51, 0xd7, 0xe8, 0xf1, 0xd8, + 0x0c, 0x53, 0x32, 0x20, 0xac, 0xb8, 0x0e, 0x47, 0x91, 0x79, 0xbc, 0x67, 0x5e, 0xe5, 0xd2, 0x74, + 0xd7, 0xe5, 0xbf, 0xbd, 0xf7, 0x27, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x81, 0x42, 0xb9, 0x63, 0x03, 0x00, 0x00, } @@ -346,6 +356,9 @@ func (this *Metadata) Equal(that interface{}) bool { if !this.SortInfo.Equal(that1.SortInfo) { return false } + if this.Tenant != that1.Tenant { + return false + } return true } func (this *ColumnDesc) Equal(that interface{}) bool { @@ -432,7 +445,7 @@ func (this *Metadata) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 6) + s := make([]string, 0, 7) s = append(s, "&logsmd.Metadata{") if this.Columns != nil { s = append(s, "Columns: "+fmt.Sprintf("%#v", this.Columns)+",\n") @@ -440,6 +453,7 @@ func (this *Metadata) GoString() string { if this.SortInfo != nil { s = append(s, "SortInfo: "+fmt.Sprintf("%#v", this.SortInfo)+",\n") } + s = append(s, "Tenant: "+fmt.Sprintf("%#v", this.Tenant)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -508,6 +522,13 @@ func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Tenant) > 0 { + i -= len(m.Tenant) + copy(dAtA[i:], m.Tenant) + i = encodeVarintLogsmd(dAtA, i, uint64(len(m.Tenant))) + i-- + dAtA[i] = 0x1a + } if m.SortInfo != nil { { size, err := m.SortInfo.MarshalToSizedBuffer(dAtA[:i]) @@ -676,6 +697,10 @@ func (m *Metadata) Size() (n int) { l = m.SortInfo.Size() n += 1 + l + sovLogsmd(uint64(l)) } + l = len(m.Tenant) + if l > 0 { + n += 1 + l + sovLogsmd(uint64(l)) + } return n } @@ -741,6 +766,7 @@ func (this *Metadata) String() string { s := strings.Join([]string{`&Metadata{`, `Columns:` + repeatedStringForColumns + `,`, `SortInfo:` + strings.Replace(fmt.Sprintf("%v", this.SortInfo), "SectionSortInfo", "datasetmd.SectionSortInfo", 1) + `,`, + `Tenant:` + fmt.Sprintf("%v", this.Tenant) + `,`, `}`, }, "") return s @@ -888,6 +914,38 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tenant", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogsmd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthLogsmd + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLogsmd + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tenant = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipLogsmd(dAtA[iNdEx:]) diff --git a/pkg/dataobj/internal/metadata/logsmd/logsmd.proto b/pkg/dataobj/internal/metadata/logsmd/logsmd.proto index 2a68fee05f..2eed3df435 100644 --- a/pkg/dataobj/internal/metadata/logsmd/logsmd.proto +++ b/pkg/dataobj/internal/metadata/logsmd/logsmd.proto @@ -15,6 +15,9 @@ message Metadata { // Section sort information. dataobj.metadata.dataset.v1.SectionSortInfo sort_info = 2; + + // The tenant who owns the streams section. + string tenant = 3; } // ColumnDesc describes an individual column within the logs table. diff --git a/pkg/dataobj/internal/metadata/streamsmd/streamsmd.pb.go b/pkg/dataobj/internal/metadata/streamsmd/streamsmd.pb.go index 35b1653cbd..2641897cc5 100644 --- a/pkg/dataobj/internal/metadata/streamsmd/streamsmd.pb.go +++ b/pkg/dataobj/internal/metadata/streamsmd/streamsmd.pb.go @@ -81,6 +81,8 @@ type Metadata struct { Columns []*ColumnDesc `protobuf:"bytes,1,rep,name=columns,proto3" json:"columns,omitempty"` // Section sort information. SortInfo *datasetmd.SectionSortInfo `protobuf:"bytes,2,opt,name=sort_info,json=sortInfo,proto3" json:"sort_info,omitempty"` + // The tenant who owns the streams section. + Tenant string `protobuf:"bytes,3,opt,name=tenant,proto3" json:"tenant,omitempty"` } func (m *Metadata) Reset() { *m = Metadata{} } @@ -129,6 +131,13 @@ func (m *Metadata) GetSortInfo() *datasetmd.SectionSortInfo { return nil } +func (m *Metadata) GetTenant() string { + if m != nil { + return m.Tenant + } + return "" +} + // ColumnDesc describes an individual column within the streams table. type ColumnDesc struct { // Information about the column. @@ -286,38 +295,39 @@ func init() { } var fileDescriptor_7b94842ca2f0bf8d = []byte{ - // 495 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xcd, 0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15, 0xf4, 0x14, 0xaa, 0xe5, 0xb4, 0xdd, - 0x79, 0xef, 0xa8, 0xab, 0xe8, 0x05, 0xdc, 0xbd, 0xdb, 0x62, 0xa3, 0x63, 0x5a, 0x36, 0x71, 0x1c, - 0xd2, 0xf4, 0x1c, 0xe3, 0x8c, 0xa8, 0x6b, 0xf5, 0x2f, 0xa3, 0x31, 0x56, 0xae, 0xc7, 0x58, 0xb9, - 0x19, 0x63, 0xf0, 0x35, 0xc3, 0xe0, 0x67, 0x86, 0xc1, 0xaf, 0x0c, 0x83, 0x51, 0x86, 0xc1, 0x9f, - 0x0c, 0x83, 0xbf, 0x19, 0x56, 0x6e, 0x32, 0x0c, 0xbe, 0x4f, 0xb0, 0x32, 0x9a, 0x60, 0xe5, 0x7a, - 0x82, 0x95, 0xb3, 0xba, 0x1f, 0x88, 0x4f, 0x17, 0x5d, 0xad, 0xc7, 0x43, 0xdd, 0x4f, 0xe8, 0x80, - 0x46, 0x54, 0x1f, 0xf2, 0xf3, 0x40, 0xbf, 0x3c, 0xd6, 0x1f, 0x78, 0x6e, 0xdd, 0x35, 0x79, 0x0f, - 0xc7, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf3, 0x6e, 0x49, 0x89, 0xa0, 0x03, 0x00, 0x00, + // 510 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4d, 0x6b, 0xdb, 0x40, + 0x10, 0xd5, 0xc6, 0x89, 0xeb, 0x6c, 0x20, 0xa8, 0x4b, 0xd3, 0x3a, 0x0d, 0x59, 0x5c, 0x43, 0x88, + 0x29, 0x45, 0xa2, 0xc9, 0xa1, 0x94, 0x9c, 0xfc, 0xb1, 0x05, 0x81, 0x65, 0x1b, 0x49, 0xa1, 0x6d, + 0x2e, 0x62, 0x6d, 0xaf, 0x55, 0x35, 0x96, 0x56, 0x48, 0x9b, 0xd0, 0xdc, 0x7a, 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f, 0x26, 0x53, 0x2c, 0x5d, 0x4f, 0xb1, 0x74, 0x33, + 0xc5, 0xe0, 0x6b, 0x8c, 0xc1, 0x8f, 0x18, 0x83, 0x5f, 0x31, 0x06, 0x93, 0x18, 0x83, 0x3f, 0x31, + 0x06, 0x7f, 0x63, 0x2c, 0xdd, 0xc4, 0x18, 0x7c, 0x9f, 0x61, 0x69, 0x32, 0xc3, 0xd2, 0xf5, 0x0c, + 0x4b, 0x67, 0x0d, 0xc7, 0x15, 0x9f, 0x2e, 0xfa, 0xca, 0x80, 0x7b, 0xaa, 0x13, 0xd2, 0x11, 0xf5, + 0xa9, 0x3a, 0xe6, 0xe7, 0xae, 0x7a, 0x79, 0xac, 0x3e, 0xf0, 0x19, 0xf6, 0x8b, 0xe9, 0x3b, 0x39, + 0xfe, 0x17, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x50, 0xca, 0x19, 0xb8, 0x03, 0x00, 0x00, } func (x ColumnType) String() string { @@ -357,6 +367,9 @@ func (this *Metadata) Equal(that interface{}) bool { if !this.SortInfo.Equal(that1.SortInfo) { return false } + if this.Tenant != that1.Tenant { + return false + } return true } func (this *ColumnDesc) Equal(that interface{}) bool { @@ -443,7 +456,7 @@ func (this *Metadata) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 6) + s := make([]string, 0, 7) s = append(s, "&streamsmd.Metadata{") if this.Columns != nil { s = append(s, "Columns: "+fmt.Sprintf("%#v", this.Columns)+",\n") @@ -451,6 +464,7 @@ func (this *Metadata) GoString() string { if this.SortInfo != nil { s = append(s, "SortInfo: "+fmt.Sprintf("%#v", this.SortInfo)+",\n") } + s = append(s, "Tenant: "+fmt.Sprintf("%#v", this.Tenant)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -519,6 +533,13 @@ func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Tenant) > 0 { + i -= len(m.Tenant) + copy(dAtA[i:], m.Tenant) + i = encodeVarintStreamsmd(dAtA, i, uint64(len(m.Tenant))) + i-- + dAtA[i] = 0x1a + } if m.SortInfo != nil { { size, err := m.SortInfo.MarshalToSizedBuffer(dAtA[:i]) @@ -687,6 +708,10 @@ func (m *Metadata) Size() (n int) { l = m.SortInfo.Size() n += 1 + l + sovStreamsmd(uint64(l)) } + l = len(m.Tenant) + if l > 0 { + n += 1 + l + sovStreamsmd(uint64(l)) + } return n } @@ -752,6 +777,7 @@ func (this *Metadata) String() string { s := strings.Join([]string{`&Metadata{`, `Columns:` + repeatedStringForColumns + `,`, `SortInfo:` + strings.Replace(fmt.Sprintf("%v", this.SortInfo), "SectionSortInfo", "datasetmd.SectionSortInfo", 1) + `,`, + `Tenant:` + fmt.Sprintf("%v", this.Tenant) + `,`, `}`, }, "") return s @@ -899,6 +925,38 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tenant", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStreamsmd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthStreamsmd + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStreamsmd + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tenant = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipStreamsmd(dAtA[iNdEx:]) diff --git a/pkg/dataobj/internal/metadata/streamsmd/streamsmd.proto b/pkg/dataobj/internal/metadata/streamsmd/streamsmd.proto index 782fc5ef7d..ff4ebbe22c 100644 --- a/pkg/dataobj/internal/metadata/streamsmd/streamsmd.proto +++ b/pkg/dataobj/internal/metadata/streamsmd/streamsmd.proto @@ -15,6 +15,9 @@ message Metadata { // Section sort information. dataobj.metadata.dataset.v1.SectionSortInfo sort_info = 2; + + // The tenant who owns the streams section. + string tenant = 3; } // ColumnDesc describes an individual column within the streams table. diff --git a/pkg/dataobj/sections/logs/encoder.go b/pkg/dataobj/sections/logs/encoder.go index 45e446e675..3c0e032571 100644 --- a/pkg/dataobj/sections/logs/encoder.go +++ b/pkg/dataobj/sections/logs/encoder.go @@ -33,7 +33,8 @@ var ( // // The zero value of encoder is ready for use. type encoder struct { - data *bytes.Buffer + tenant string + data *bytes.Buffer columns []*logsmd.ColumnDesc // closed columns. curColumn *logsmd.ColumnDesc // curColumn is the currently open column. @@ -94,6 +95,7 @@ func (enc *encoder) Metadata() proto.Message { columns = append(columns, enc.curColumn) } return &logsmd.Metadata{ + Tenant: enc.tenant, Columns: columns, SortInfo: enc.sortInfo, } @@ -137,11 +139,17 @@ func (enc *encoder) Flush(w dataobj.SectionWriter) (int64, error) { // columns. func (enc *encoder) Reset() { bufpool.PutUnsized(enc.data) + enc.tenant = "" enc.data = nil enc.curColumn = nil enc.sortInfo = nil } +// SetTenant sets the tenant who owns the streams section. +func (enc *encoder) SetTenant(tenant string) { + enc.tenant = tenant +} + // append adds data and metadata to enc. append must only be called from child // elements on Close and Discard. Discard calls must pass nil for both data and // metadata to denote a discard. diff --git a/pkg/dataobj/sections/streams/encoder.go b/pkg/dataobj/sections/streams/encoder.go index 78f9260c6e..88cbed5023 100644 --- a/pkg/dataobj/sections/streams/encoder.go +++ b/pkg/dataobj/sections/streams/encoder.go @@ -33,7 +33,8 @@ var ( // // The zero value of encoder is ready for use. type encoder struct { - data *bytes.Buffer + tenant string + data *bytes.Buffer columns []*streamsmd.ColumnDesc // closed columns. curColumn *streamsmd.ColumnDesc // curColumn is the currently open column. @@ -86,7 +87,10 @@ func (enc *encoder) Metadata() proto.Message { if enc.curColumn != nil { columns = append(columns, enc.curColumn) } - return &streamsmd.Metadata{Columns: columns} + return &streamsmd.Metadata{ + Tenant: enc.tenant, + Columns: columns, + } } // Flush writes the section to the given [dataobj.SectionWriter]. Flush @@ -126,10 +130,16 @@ func (enc *encoder) Flush(w dataobj.SectionWriter) (int64, error) { // columns. func (enc *encoder) Reset() { bufpool.PutUnsized(enc.data) + enc.tenant = "" enc.data = nil enc.curColumn = nil } +// SetTenant sets the tenant who owns the streams section. +func (enc *encoder) SetTenant(tenant string) { + enc.tenant = tenant +} + // append adds data and metadata to enc. append must only be called from child // elements on Close and Discard. Discard calls must pass nil for both data and // metadata to denote a discard.