From 27921564c03181eb696b9a0db8e9c9510f0338a0 Mon Sep 17 00:00:00 2001 From: Travis Date: Fri, 15 Sep 2017 22:39:19 -0500 Subject: [PATCH 1/3] Make sure Fields gets encoded with FrameOptions --- frame.go | 3 + internal/private.pb.go | 187 +++++++++++++++++++++++++++-------------- internal/private.proto | 3 +- server.go | 2 + 4 files changed, 129 insertions(+), 66 deletions(-) diff --git a/frame.go b/frame.go index ef978d8c1..3c52a8e94 100644 --- a/frame.go +++ b/frame.go @@ -230,6 +230,7 @@ func (f *Frame) options() FrameOptions { CacheType: f.cacheType, CacheSize: f.cacheSize, TimeQuantum: f.timeQuantum, + Fields: f.schema.Fields, } return opt } @@ -933,6 +934,7 @@ func encodeFrame(f *Frame) *internal.Frame { CacheType: f.cacheType, CacheSize: f.cacheSize, TimeQuantum: string(f.timeQuantum), + Fields: encodeFields(f.schema.Fields), }, } } @@ -975,6 +977,7 @@ func (o *FrameOptions) Encode() *internal.FrameMeta { CacheType: o.CacheType, CacheSize: o.CacheSize, TimeQuantum: string(o.TimeQuantum), + Fields: encodeFields(o.Fields), } } diff --git a/internal/private.pb.go b/internal/private.pb.go index 0a9956279..786279cf6 100644 --- a/internal/private.pb.go +++ b/internal/private.pb.go @@ -64,12 +64,13 @@ func (*IndexMeta) ProtoMessage() {} func (*IndexMeta) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{0} } type FrameMeta struct { - RowLabel string `protobuf:"bytes,1,opt,name=RowLabel,proto3" json:"RowLabel,omitempty"` - InverseEnabled bool `protobuf:"varint,2,opt,name=InverseEnabled,proto3" json:"InverseEnabled,omitempty"` - CacheType string `protobuf:"bytes,3,opt,name=CacheType,proto3" json:"CacheType,omitempty"` - CacheSize uint32 `protobuf:"varint,4,opt,name=CacheSize,proto3" json:"CacheSize,omitempty"` - TimeQuantum string `protobuf:"bytes,5,opt,name=TimeQuantum,proto3" json:"TimeQuantum,omitempty"` - RangeEnabled bool `protobuf:"varint,6,opt,name=RangeEnabled,proto3" json:"RangeEnabled,omitempty"` + RowLabel string `protobuf:"bytes,1,opt,name=RowLabel,proto3" json:"RowLabel,omitempty"` + InverseEnabled bool `protobuf:"varint,2,opt,name=InverseEnabled,proto3" json:"InverseEnabled,omitempty"` + CacheType string `protobuf:"bytes,3,opt,name=CacheType,proto3" json:"CacheType,omitempty"` + CacheSize uint32 `protobuf:"varint,4,opt,name=CacheSize,proto3" json:"CacheSize,omitempty"` + TimeQuantum string `protobuf:"bytes,5,opt,name=TimeQuantum,proto3" json:"TimeQuantum,omitempty"` + RangeEnabled bool `protobuf:"varint,6,opt,name=RangeEnabled,proto3" json:"RangeEnabled,omitempty"` + Fields []*Field `protobuf:"bytes,7,rep,name=Fields" json:"Fields,omitempty"` } func (m *FrameMeta) Reset() { *m = FrameMeta{} } @@ -77,6 +78,13 @@ func (m *FrameMeta) String() string { return proto.CompactTextString( func (*FrameMeta) ProtoMessage() {} func (*FrameMeta) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{1} } +func (m *FrameMeta) GetFields() []*Field { + if m != nil { + return m.Fields + } + return nil +} + type ImportResponse struct { Err string `protobuf:"bytes,1,opt,name=Err,proto3" json:"Err,omitempty"` } @@ -531,6 +539,18 @@ func (m *FrameMeta) MarshalTo(dAtA []byte) (int, error) { } i++ } + if len(m.Fields) > 0 { + for _, msg := range m.Fields { + dAtA[i] = 0x3a + i++ + i = encodeVarintPrivate(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } return i, nil } @@ -1458,6 +1478,12 @@ func (m *FrameMeta) Size() (n int) { if m.RangeEnabled { n += 2 } + if len(m.Fields) > 0 { + for _, e := range m.Fields { + l = e.Size() + n += 1 + l + sovPrivate(uint64(l)) + } + } return n } @@ -2136,6 +2162,37 @@ func (m *FrameMeta) Unmarshal(dAtA []byte) error { } } m.RangeEnabled = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPrivate + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fields = append(m.Fields, &Field{}) + if err := m.Fields[len(m.Fields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPrivate(dAtA[iNdEx:]) @@ -5194,64 +5251,64 @@ var ( func init() { proto.RegisterFile("private.proto", fileDescriptorPrivate) } var fileDescriptorPrivate = []byte{ - // 929 bytes of a gzipped FileDescriptorProto + // 940 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xc1, 0x6e, 0x23, 0x45, - 0x10, 0x65, 0xec, 0xb1, 0xb1, 0x2b, 0x24, 0x71, 0x9a, 0xb0, 0xf2, 0x46, 0x91, 0x89, 0xfa, 0xc0, - 0x86, 0x48, 0xe4, 0xb0, 0x48, 0x2b, 0x60, 0x39, 0xc0, 0xc6, 0x59, 0xc5, 0x02, 0x2f, 0xd0, 0x5e, - 0x2d, 0x37, 0xa4, 0x8e, 0x53, 0xec, 0x8e, 0x32, 0x9e, 0x31, 0x33, 0x3d, 0x49, 0xcc, 0x81, 0x23, - 0xdf, 0x80, 0xc4, 0x91, 0x9f, 0xe1, 0x08, 0x7f, 0x80, 0xc2, 0x85, 0x3f, 0xe0, 0xba, 0xea, 0xea, - 0xee, 0x99, 0xf1, 0x38, 0x76, 0x94, 0xbd, 0x75, 0xbd, 0x7e, 0x5d, 0xf5, 0xba, 0xa6, 0xaa, 0xa6, - 0x61, 0x7d, 0x9a, 0x04, 0x17, 0x52, 0xe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, + 0x6d, 0x17, 0x27, 0x0b, 0x2a, 0xc2, 0xb8, 0xf0, 0xc7, 0xd0, 0xa4, 0x6a, 0x19, 0x8e, 0x5e, 0xe3, + 0x58, 0x96, 0x9e, 0x08, 0xde, 0xfa, 0x27, 0xc2, 0x10, 0xaa, 0xab, 0x5b, 0x84, 0x41, 0x40, 0xaf, + 0x1c, 0x2b, 0x04, 0x3d, 0x70, 0x5a, 0xe0, 0x0f, 0x42, 0xf3, 0x19, 0x7c, 0xa1, 0x97, 0x84, 0xc8, + 0x2b, 0x2a, 0x13, 0x8d, 0x48, 0xfd, 0x0f, 0xd9, 0x32, 0xb2, 0xeb, 0x3f, 0xfc, 0x9b, 0x4c, 0x7b, + 0xf7, 0x50, 0xf0, 0x8b, 0x87, 0xc2, 0xd3, 0xd6, 0x1f, 0xd7, 0x1d, 0xef, 0xcf, 0xeb, 0x8e, 0xf7, + 0xd7, 0x75, 0xc7, 0xfb, 0xf5, 0xef, 0xce, 0x5b, 0xa7, 0x35, 0x7a, 0x3d, 0x7e, 0xf4, 0x7f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x59, 0x39, 0x2e, 0xa5, 0x4e, 0x0a, 0x00, 0x00, } diff --git a/internal/private.proto b/internal/private.proto index 68e9a5e5f..e37ca48b6 100644 --- a/internal/private.proto +++ b/internal/private.proto @@ -14,6 +14,7 @@ message FrameMeta { uint32 CacheSize = 4; string TimeQuantum = 5; bool RangeEnabled = 6; + repeated Field Fields = 7; } message ImportResponse { @@ -136,4 +137,4 @@ message DeleteViewMessage { string Index = 1; string Frame = 2; string View = 3; -} \ No newline at end of file +} diff --git a/server.go b/server.go index 8194278ba..b785cdda1 100644 --- a/server.go +++ b/server.go @@ -314,9 +314,11 @@ func (s *Server) ReceiveMessage(pb proto.Message) error { opt := FrameOptions{ RowLabel: obj.Meta.RowLabel, InverseEnabled: obj.Meta.InverseEnabled, + RangeEnabled: obj.Meta.RangeEnabled, CacheType: obj.Meta.CacheType, CacheSize: obj.Meta.CacheSize, TimeQuantum: TimeQuantum(obj.Meta.TimeQuantum), + Fields: decodeFields(obj.Meta.Fields), } _, err := idx.CreateFrame(obj.Frame, opt) if err != nil { From 80603ef28a16b4db6537985be853fbb667544f37 Mon Sep 17 00:00:00 2001 From: Travis Date: Sat, 16 Sep 2017 18:05:44 -0500 Subject: [PATCH 2/3] remove some code duplication in FrameOption encoding --- frame.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/frame.go b/frame.go index 3c52a8e94..7c785aaa0 100644 --- a/frame.go +++ b/frame.go @@ -223,7 +223,7 @@ func (f *Frame) Options() FrameOptions { } func (f *Frame) options() FrameOptions { - opt := FrameOptions{ + return FrameOptions{ RowLabel: f.rowLabel, InverseEnabled: f.inverseEnabled, RangeEnabled: f.rangeEnabled, @@ -232,7 +232,6 @@ func (f *Frame) options() FrameOptions { TimeQuantum: f.timeQuantum, Fields: f.schema.Fields, } - return opt } // Open opens and initializes the frame. @@ -925,17 +924,10 @@ func encodeFrames(a []*Frame) []*internal.Frame { // encodeFrame converts f into its internal representation. func encodeFrame(f *Frame) *internal.Frame { + options := f.Options() return &internal.Frame{ Name: f.name, - Meta: &internal.FrameMeta{ - RowLabel: f.rowLabel, - InverseEnabled: f.inverseEnabled, - RangeEnabled: f.rangeEnabled, - CacheType: f.cacheType, - CacheSize: f.cacheSize, - TimeQuantum: string(f.timeQuantum), - Fields: encodeFields(f.schema.Fields), - }, + Meta: options.Encode(), } } From c8c2229ca3e79e66f4aa2f47f7757a48f35e5b6c Mon Sep 17 00:00:00 2001 From: Travis Date: Sat, 16 Sep 2017 18:23:40 -0500 Subject: [PATCH 3/3] remove some code duplication in IndexOptions --- frame.go | 4 ++-- index.go | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/frame.go b/frame.go index 7c785aaa0..081f71700 100644 --- a/frame.go +++ b/frame.go @@ -924,10 +924,10 @@ func encodeFrames(a []*Frame) []*internal.Frame { // encodeFrame converts f into its internal representation. func encodeFrame(f *Frame) *internal.Frame { - options := f.Options() + fo := f.options() return &internal.Frame{ Name: f.name, - Meta: options.Encode(), + Meta: fo.Encode(), } } diff --git a/index.go b/index.go index d04a1871b..67aae389d 100644 --- a/index.go +++ b/index.go @@ -614,12 +614,10 @@ func EncodeIndexes(a []*Index) []*internal.Index { // encodeIndex converts d into its internal representation. func encodeIndex(d *Index) *internal.Index { + io := d.options() return &internal.Index{ - Name: d.name, - Meta: &internal.IndexMeta{ - ColumnLabel: d.columnLabel, - TimeQuantum: string(d.timeQuantum), - }, + Name: d.name, + Meta: io.Encode(), MaxSlice: d.MaxSlice(), Frames: encodeFrames(d.Frames()), }