From 9b8d1ad4f9353f2891aad63702e4c489d963242c Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Mon, 29 Jan 2018 09:34:56 -0600 Subject: [PATCH 1/2] add CreateViewMessage for broadcaster --- broadcast.go | 39 ++-- frame.go | 23 +++ internal/private.pb.go | 393 ++++++++++++++++++++++++++++++++--------- internal/private.proto | 6 + server.go | 9 + 5 files changed, 369 insertions(+), 101 deletions(-) diff --git a/broadcast.go b/broadcast.go index 0a9b671ec..7d00f1107 100644 --- a/broadcast.go +++ b/broadcast.go @@ -130,19 +130,20 @@ func (n *nopGossiper) SendAsync(pb proto.Message) error { // Broadcast message types. const ( - MessageTypeCreateSlice = 1 - MessageTypeCreateIndex = 2 - MessageTypeDeleteIndex = 3 - MessageTypeCreateFrame = 4 - MessageTypeDeleteFrame = 5 - MessageTypeCreateInputDefinition = 6 - MessageTypeDeleteInputDefinition = 7 - MessageTypeDeleteView = 8 - MessageTypeClusterStatus = 9 - MessageTypeResizeInstruction = 10 - MessageTypeResizeInstructionComplete = 11 - MessageTypeSetCoordinator = 12 - MessageTypeNodeState = 13 + MessageTypeCreateSlice = iota + MessageTypeCreateIndex + MessageTypeDeleteIndex + MessageTypeCreateFrame + MessageTypeDeleteFrame + MessageTypeCreateView + MessageTypeDeleteView + MessageTypeCreateInputDefinition + MessageTypeDeleteInputDefinition + MessageTypeClusterStatus + MessageTypeResizeInstruction + MessageTypeResizeInstructionComplete + MessageTypeSetCoordinator + MessageTypeNodeState ) // MarshalMessage encodes the protobuf message into a byte slice. @@ -159,12 +160,14 @@ func MarshalMessage(m proto.Message) ([]byte, error) { typ = MessageTypeCreateFrame case *internal.DeleteFrameMessage: typ = MessageTypeDeleteFrame + case *internal.CreateViewMessage: + typ = MessageTypeCreateView + case *internal.DeleteViewMessage: + typ = MessageTypeDeleteView case *internal.CreateInputDefinitionMessage: typ = MessageTypeCreateInputDefinition case *internal.DeleteInputDefinitionMessage: typ = MessageTypeDeleteInputDefinition - case *internal.DeleteViewMessage: - typ = MessageTypeDeleteView case *internal.ClusterStatus: typ = MessageTypeClusterStatus case *internal.ResizeInstruction: @@ -201,12 +204,14 @@ func UnmarshalMessage(buf []byte) (proto.Message, error) { m = &internal.CreateFrameMessage{} case MessageTypeDeleteFrame: m = &internal.DeleteFrameMessage{} + case MessageTypeCreateView: + m = &internal.CreateViewMessage{} + case MessageTypeDeleteView: + m = &internal.DeleteViewMessage{} case MessageTypeCreateInputDefinition: m = &internal.CreateInputDefinitionMessage{} case MessageTypeDeleteInputDefinition: m = &internal.DeleteInputDefinitionMessage{} - case MessageTypeDeleteView: - m = &internal.DeleteViewMessage{} case MessageTypeClusterStatus: m = &internal.ClusterStatus{} case MessageTypeResizeInstruction: diff --git a/frame.go b/frame.go index 84af0c4fd..b5807dc71 100644 --- a/frame.go +++ b/frame.go @@ -571,7 +571,30 @@ func (f *Frame) RecalculateCaches() { } // CreateViewIfNotExists returns the named view, creating it if necessary. +// Additionally, a CreateViewMessage is sent to the cluster. func (f *Frame) CreateViewIfNotExists(name string) (*View, error) { + + view, err := f.CreateViewIfNotExistsBase(name) + if err != nil { + return nil, err + } + + // Broadcast view creation to the cluster. + err = f.broadcaster.SendSync( + &internal.CreateViewMessage{ + Index: f.index, + Frame: f.name, + View: name, + }) + if err != nil { + return nil, err + } + + return view, nil +} + +// CreateViewIfNotExistsBase returns the named view, creating it if necessary. +func (f *Frame) CreateViewIfNotExistsBase(name string) (*View, error) { // Don't create inverse views if they are not enabled. if !f.InverseEnabled() && IsInverseView(name) { return nil, ErrFrameInverseDisabled diff --git a/internal/private.pb.go b/internal/private.pb.go index 7e4fca2ea..905f004d5 100644 --- a/internal/private.pb.go +++ b/internal/private.pb.go @@ -34,6 +34,7 @@ NodeStatus ClusterStatus Field + CreateViewMessage DeleteViewMessage ResizeInstruction ResizeSource @@ -800,6 +801,38 @@ func (m *Field) GetMax() int64 { return 0 } +type CreateViewMessage struct { + Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` + Frame string `protobuf:"bytes,2,opt,name=Frame,proto3" json:"Frame,omitempty"` + View string `protobuf:"bytes,3,opt,name=View,proto3" json:"View,omitempty"` +} + +func (m *CreateViewMessage) Reset() { *m = CreateViewMessage{} } +func (m *CreateViewMessage) String() string { return proto.CompactTextString(m) } +func (*CreateViewMessage) ProtoMessage() {} +func (*CreateViewMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{25} } + +func (m *CreateViewMessage) GetIndex() string { + if m != nil { + return m.Index + } + return "" +} + +func (m *CreateViewMessage) GetFrame() string { + if m != nil { + return m.Frame + } + return "" +} + +func (m *CreateViewMessage) GetView() string { + if m != nil { + return m.View + } + return "" +} + type DeleteViewMessage struct { Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` Frame string `protobuf:"bytes,2,opt,name=Frame,proto3" json:"Frame,omitempty"` @@ -809,7 +842,7 @@ type DeleteViewMessage struct { func (m *DeleteViewMessage) Reset() { *m = DeleteViewMessage{} } func (m *DeleteViewMessage) String() string { return proto.CompactTextString(m) } func (*DeleteViewMessage) ProtoMessage() {} -func (*DeleteViewMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{25} } +func (*DeleteViewMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{26} } func (m *DeleteViewMessage) GetIndex() string { if m != nil { @@ -844,7 +877,7 @@ type ResizeInstruction struct { func (m *ResizeInstruction) Reset() { *m = ResizeInstruction{} } func (m *ResizeInstruction) String() string { return proto.CompactTextString(m) } func (*ResizeInstruction) ProtoMessage() {} -func (*ResizeInstruction) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{26} } +func (*ResizeInstruction) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{27} } func (m *ResizeInstruction) GetJobID() int64 { if m != nil { @@ -899,7 +932,7 @@ type ResizeSource struct { func (m *ResizeSource) Reset() { *m = ResizeSource{} } func (m *ResizeSource) String() string { return proto.CompactTextString(m) } func (*ResizeSource) ProtoMessage() {} -func (*ResizeSource) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{27} } +func (*ResizeSource) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{28} } func (m *ResizeSource) GetURI() *URI { if m != nil { @@ -946,7 +979,7 @@ func (m *ResizeInstructionComplete) Reset() { *m = ResizeInstructionComp func (m *ResizeInstructionComplete) String() string { return proto.CompactTextString(m) } func (*ResizeInstructionComplete) ProtoMessage() {} func (*ResizeInstructionComplete) Descriptor() ([]byte, []int) { - return fileDescriptorPrivate, []int{28} + return fileDescriptorPrivate, []int{29} } func (m *ResizeInstructionComplete) GetJobID() int64 { @@ -978,7 +1011,7 @@ type SetCoordinatorMessage struct { func (m *SetCoordinatorMessage) Reset() { *m = SetCoordinatorMessage{} } func (m *SetCoordinatorMessage) String() string { return proto.CompactTextString(m) } func (*SetCoordinatorMessage) ProtoMessage() {} -func (*SetCoordinatorMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{29} } +func (*SetCoordinatorMessage) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{30} } func (m *SetCoordinatorMessage) GetOld() *URI { if m != nil { @@ -1002,7 +1035,7 @@ type Topology struct { func (m *Topology) Reset() { *m = Topology{} } func (m *Topology) String() string { return proto.CompactTextString(m) } func (*Topology) ProtoMessage() {} -func (*Topology) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{30} } +func (*Topology) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{31} } func (m *Topology) GetNodeSet() []*URI { if m != nil { @@ -1044,6 +1077,7 @@ func init() { proto.RegisterType((*NodeStatus)(nil), "internal.NodeStatus") proto.RegisterType((*ClusterStatus)(nil), "internal.ClusterStatus") proto.RegisterType((*Field)(nil), "internal.Field") + proto.RegisterType((*CreateViewMessage)(nil), "internal.CreateViewMessage") proto.RegisterType((*DeleteViewMessage)(nil), "internal.DeleteViewMessage") proto.RegisterType((*ResizeInstruction)(nil), "internal.ResizeInstruction") proto.RegisterType((*ResizeSource)(nil), "internal.ResizeSource") @@ -2063,6 +2097,42 @@ func (m *Field) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *CreateViewMessage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreateViewMessage) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Index) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintPrivate(dAtA, i, uint64(len(m.Index))) + i += copy(dAtA[i:], m.Index) + } + if len(m.Frame) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintPrivate(dAtA, i, uint64(len(m.Frame))) + i += copy(dAtA[i:], m.Frame) + } + if len(m.View) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintPrivate(dAtA, i, uint64(len(m.View))) + i += copy(dAtA[i:], m.View) + } + return i, nil +} + func (m *DeleteViewMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2810,6 +2880,24 @@ func (m *Field) Size() (n int) { return n } +func (m *CreateViewMessage) Size() (n int) { + var l int + _ = l + l = len(m.Index) + if l > 0 { + n += 1 + l + sovPrivate(uint64(l)) + } + l = len(m.Frame) + if l > 0 { + n += 1 + l + sovPrivate(uint64(l)) + } + l = len(m.View) + if l > 0 { + n += 1 + l + sovPrivate(uint64(l)) + } + return n +} + func (m *DeleteViewMessage) Size() (n int) { var l int _ = l @@ -6399,6 +6487,143 @@ func (m *Field) Unmarshal(dAtA []byte) error { } return nil } +func (m *CreateViewMessage) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateViewMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateViewMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + 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 ErrInvalidLengthPrivate + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Frame", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + 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 ErrInvalidLengthPrivate + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Frame = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field View", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPrivate + } + 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 ErrInvalidLengthPrivate + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.View = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPrivate(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthPrivate + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *DeleteViewMessage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7422,82 +7647,82 @@ var ( func init() { proto.RegisterFile("private.proto", fileDescriptorPrivate) } var fileDescriptorPrivate = []byte{ - // 1222 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xff, 0xae, 0xd7, 0x76, 0xec, 0xe7, 0xba, 0x75, 0xe7, 0x9b, 0x06, 0x27, 0x8a, 0x5c, 0x33, - 0x07, 0x12, 0x2a, 0x11, 0xc0, 0x95, 0x10, 0x04, 0x55, 0x82, 0xc6, 0xae, 0xba, 0x40, 0x92, 0x76, - 0x9c, 0x16, 0xc1, 0x01, 0x69, 0x62, 0x0f, 0xc9, 0x2a, 0xeb, 0x5d, 0xb3, 0x3b, 0x4e, 0xe2, 0x1e, - 0xb8, 0xc1, 0x01, 0xee, 0x88, 0x3b, 0xff, 0x0c, 0x47, 0xfe, 0x04, 0x14, 0xfe, 0x08, 0x24, 0x2e, - 0xa0, 0x79, 0x3b, 0xb3, 0xbb, 0xfe, 0x95, 0x34, 0xb9, 0xed, 0x7b, 0xf3, 0x79, 0x6f, 0x3e, 0xf3, - 0x7e, 0xcd, 0x2c, 0x54, 0x87, 0xa1, 0x7b, 0xca, 0xa5, 0xd8, 0x1a, 0x86, 0x81, 0x0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0xc3, 0x22, 0xfe, 0xfd, 0x3d, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x4f, - 0x86, 0xdb, 0x0e, 0x0e, 0x00, 0x00, + // 1229 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0x67, 0xbd, 0xb6, 0x63, 0x3f, 0xc7, 0x8d, 0x33, 0xa4, 0xc1, 0x89, 0x22, 0xd7, 0xcc, 0x81, + 0x84, 0x4a, 0x04, 0x70, 0x25, 0x04, 0x41, 0x95, 0xa0, 0xb1, 0xab, 0x2e, 0x90, 0xa4, 0x1d, 0xa7, + 0x45, 0x70, 0x40, 0x9a, 0xd8, 0x43, 0xb2, 0xca, 0x7a, 0xd7, 0xec, 0x8e, 0x93, 0xb8, 0x07, 0x6e, + 0x70, 0x80, 0x3b, 0xe2, 0xce, 0x97, 0xe1, 0xc8, 0x47, 0x40, 0xe1, 0x43, 0x20, 0x71, 0x01, 0xcd, + 0xbf, 0xdd, 0xf5, 0xda, 0x4e, 0x9a, 0x88, 0xdb, 0xbe, 0x37, 0xbf, 0xf7, 0xe6, 0x37, 0xef, 0xdf, + 0xcc, 0x42, 0x75, 0x18, 0xba, 0x67, 0x94, 0xb3, 0xed, 0x61, 0x18, 0xf0, 0x00, 0x95, 0x5c, 0x9f, + 0xb3, 0xd0, 0xa7, 0x1e, 0x3e, 0x80, 0xb2, 0xe3, 0xf7, 0xd9, 0xc5, 0x1e, 0xe3, 0x14, 0x35, 0xa1, + 0xb2, 0x1b, 0x78, 0xa3, 0x81, 0xff, 0x05, 0x3d, 0x62, 0x5e, 0xdd, 0x6a, 0x5a, 0x5b, 0x65, 0x92, + 0x56, 0x09, 0xc4, 0xa1, 0x3b, 0x60, 0xcf, 0x46, 0xd4, 0xe7, 0xa3, 0x41, 0x3d, 0xa7, 0x10, 0x29, + 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0x7d, 0x09, 0xab, 0x19, 0x5f, 0x9f, 0xf6, 0x54, 0x88, 0x14, 0xa9, 0x7b, + 0x73, 0x49, 0x29, 0x1c, 0x99, 0x63, 0x8e, 0xff, 0xb6, 0xe0, 0xee, 0xcc, 0xa5, 0xa4, 0xfa, 0xac, + 0x74, 0xa1, 0xdf, 0x87, 0xda, 0x0b, 0x31, 0x18, 0xda, 0x2c, 0xe2, 0xae, 0x4f, 0x05, 0x52, 0x97, + 0xe7, 0x94, 0x1e, 0x39, 0x50, 0x92, 0xba, 0x3d, 0x3a, 0xd4, 0x34, 0xdf, 0xb9, 0x86, 0xe6, 0xb6, + 0xc1, 0xeb, 0xb9, 0x69, 0x44, 0x41, 0x46, 0xce, 0x71, 0x73, 0x29, 0x48, 0x41, 0x4c, 0xc4, 0x09, + 0x83, 0x1b, 0x4d, 0xb5, 0x00, 0x36, 0xcc, 0x24, 0x99, 0x60, 0x72, 0x75, 0x4f, 0x7e, 0x04, 0x90, + 0x40, 0x75, 0xbb, 0x5f, 0x51, 0x9f, 0x29, 0x30, 0x7e, 0x02, 0x1b, 0x66, 0xcc, 0xdd, 0x60, 0x43, + 0x53, 0x2d, 0xb9, 0xa4, 0x5a, 0x70, 0x07, 0xec, 0xe7, 0xc4, 0x11, 0x57, 0x9d, 0xec, 0x56, 0x93, + 0x22, 0x2d, 0x09, 0x93, 0x27, 0x41, 0xc4, 0x8d, 0x89, 0xf8, 0x16, 0xba, 0xa7, 0x41, 0xc8, 0x25, + 0xe3, 0x2a, 0x91, 0xdf, 0xd8, 0x81, 0xda, 0x7e, 0xd0, 0x67, 0x5d, 0x4e, 0x79, 0x3c, 0x89, 0xee, + 0x49, 0xd7, 0xd2, 0x61, 0xa5, 0x55, 0x4d, 0x0e, 0xf6, 0x9c, 0x38, 0x44, 0x6e, 0x2a, 0x06, 0xbc, + 0x30, 0x30, 0x43, 0x49, 0x0a, 0xf8, 0x27, 0x0b, 0xc0, 0xf8, 0x1a, 0x45, 0xd7, 0x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 0xab, 0xcb, 0x08, 0x3d, 0xcc, 0x94, 0x91, 0x7c, 0x50, 0x57, 0x5a, 0x6f, + 0x24, 0x06, 0x13, 0xcb, 0x64, 0x12, 0x8d, 0x7f, 0xb0, 0x60, 0x31, 0x4d, 0xe1, 0x95, 0x5a, 0x4b, + 0xa5, 0x22, 0x37, 0x33, 0x15, 0xf6, 0xac, 0x54, 0xe4, 0x93, 0x54, 0x24, 0x6f, 0xaf, 0x42, 0xea, + 0xed, 0x85, 0x4f, 0x60, 0x6d, 0x2a, 0x3f, 0xbb, 0xc1, 0x60, 0x28, 0x0a, 0xe1, 0xb6, 0x79, 0x5a, + 0x81, 0x42, 0x27, 0x0c, 0x75, 0x86, 0xca, 0x44, 0x09, 0xf8, 0x2b, 0xb8, 0xdb, 0x65, 0x3c, 0x95, + 0x9e, 0xd4, 0x50, 0x39, 0xf0, 0xfa, 0x73, 0x4e, 0x7e, 0xe0, 0xf5, 0x05, 0x60, 0x9f, 0x9d, 0xcf, + 0xd9, 0x70, 0x9f, 0x9d, 0xe3, 0x67, 0x50, 0x3a, 0x0c, 0x86, 0x81, 0x17, 0x1c, 0x8f, 0xd3, 0x7d, + 0x6b, 0xbd, 0x7a, 0xdf, 0xe6, 0x32, 0x7d, 0xfb, 0xa8, 0xf6, 0xfb, 0x65, 0xc3, 0xfa, 0xe3, 0xb2, + 0x61, 0xfd, 0x79, 0xd9, 0xb0, 0x7e, 0xfd, 0xab, 0xf1, 0xda, 0x51, 0x51, 0xfe, 0x52, 0x3e, 0xf8, + 0x2f, 0x00, 0x00, 0xff, 0xff, 0x59, 0x94, 0x30, 0x6d, 0x63, 0x0e, 0x00, 0x00, } diff --git a/internal/private.proto b/internal/private.proto index cf1b56867..4877707a2 100644 --- a/internal/private.proto +++ b/internal/private.proto @@ -145,6 +145,12 @@ message Field { int64 Max = 4; } +message CreateViewMessage { + string Index = 1; + string Frame = 2; + string View = 3; +} + message DeleteViewMessage { string Index = 1; string Frame = 2; diff --git a/server.go b/server.go index aeb1e9519..6b7d49cc5 100644 --- a/server.go +++ b/server.go @@ -408,6 +408,15 @@ func (s *Server) ReceiveMessage(pb proto.Message) error { if err != nil { return err } + case *internal.CreateViewMessage: + f := s.Holder.Frame(obj.Index, obj.Frame) + if f == nil { + return fmt.Errorf("Local Frame not found: %s", obj.Frame) + } + _, err := f.CreateViewIfNotExistsBase(obj.View) + if err != nil { + return err + } case *internal.DeleteViewMessage: f := s.Holder.Frame(obj.Index, obj.Frame) if f == nil { From d3590098f640095d94b99cb55f448673b08e7c26 Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Mon, 29 Jan 2018 10:31:49 -0600 Subject: [PATCH 2/2] perform FrameRestore on both nodes in test cluster --- server/server_test.go | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/server/server_test.go b/server/server_test.go index 379175c75..352fc6121 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -270,10 +270,11 @@ func TestMain_SetColumnAttrsWithColumnOption(t *testing.T) { // Ensure program can set bits on one cluster and then restore to a second cluster. func TestMain_FrameRestore(t *testing.T) { mains1 := test.NewMainArrayWithCluster(2) - m0 := mains1[0] + m10 := mains1[0] + m11 := mains1[1] // Create frames. - client := m0.Client() + client := m10.Client() if err := client.CreateIndex(context.Background(), "i", pilosa.IndexOptions{}); err != nil && err != pilosa.ErrIndexExists { t.Fatal("create index:", err) } @@ -282,7 +283,7 @@ func TestMain_FrameRestore(t *testing.T) { } // Write data on first cluster. - if _, err := m0.Query("i", "", ` + if _, err := m10.Query("i", "", ` SetBit(rowID=1, frame="f", columnID=100) SetBit(rowID=1, frame="f", columnID=1000) SetBit(rowID=1, frame="f", columnID=100000) @@ -295,7 +296,7 @@ func TestMain_FrameRestore(t *testing.T) { } // Query row on first cluster. - if res, err := m0.Query("i", "", `Bitmap(rowID=1, frame="f")`); err != nil { + if res, err := m10.Query("i", "", `Bitmap(rowID=1, frame="f")`); err != nil { t.Fatal("bitmap query:", err) } else if res != `{"results":[{"attrs":{},"bits":[100,1000,100000,200000,400000,600000,800000]}]}`+"\n" { t.Fatalf("unexpected result: %s", res) @@ -303,26 +304,37 @@ func TestMain_FrameRestore(t *testing.T) { // Start second cluster. mains2 := test.NewMainArrayWithCluster(2) - m2 := mains2[0] - defer m2.Close() + m20 := mains2[0] + defer m20.Close() + m21 := mains2[1] + defer m21.Close() // Import from first cluster. - client, err := pilosa.NewInternalHTTPClient(m2.Server.URI.HostPort(), pilosa.GetHTTPClient(nil)) + client20, err := pilosa.NewInternalHTTPClient(m20.Server.URI.HostPort(), pilosa.GetHTTPClient(nil)) if err != nil { t.Fatal("new client:", err) } - if err := m2.Client().CreateIndex(context.Background(), "i", pilosa.IndexOptions{}); err != nil && err != pilosa.ErrIndexExists { + client21, err := pilosa.NewInternalHTTPClient(m21.Server.URI.HostPort(), pilosa.GetHTTPClient(nil)) + if err != nil { + t.Fatal("new client:", err) + } + + if err := m20.Client().CreateIndex(context.Background(), "i", pilosa.IndexOptions{}); err != nil && err != pilosa.ErrIndexExists { t.Fatal("create new index:", err) } - if err := m2.Client().CreateFrame(context.Background(), "i", "f", pilosa.FrameOptions{}); err != nil { + if err := m20.Client().CreateFrame(context.Background(), "i", "f", pilosa.FrameOptions{}); err != nil { t.Fatal("create new frame:", err) } - if err := client.RestoreFrame(context.Background(), m0.Server.URI.HostPort(), "i", "f"); err != nil { + + if err := client20.RestoreFrame(context.Background(), m10.Server.URI.HostPort(), "i", "f"); err != nil { + t.Fatal("restore frame:", err) + } + if err := client21.RestoreFrame(context.Background(), m11.Server.URI.HostPort(), "i", "f"); err != nil { t.Fatal("restore frame:", err) } // Query row on second cluster. - if res, err := m2.Query("i", "", `Bitmap(rowID=1, frame="f")`); err != nil { + if res, err := m20.Query("i", "", `Bitmap(rowID=1, frame="f")`); err != nil { t.Fatal("another bitmap query:", err) } else if res != `{"results":[{"attrs":{},"bits":[100,1000,100000,200000,400000,600000,800000]}]}`+"\n" { t.Fatalf("2unexpected result: %s", res)