diff --git a/proto/pilosa.pb.go b/proto/pilosa.pb.go index 9ac5095f2..e4c9b045c 100644 --- a/proto/pilosa.pb.go +++ b/proto/pilosa.pb.go @@ -838,6 +838,349 @@ func (*IdsOrKeys) XXX_OneofWrappers() []interface{} { } } +type Index struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Index) Reset() { *m = Index{} } +func (m *Index) String() string { return proto.CompactTextString(m) } +func (*Index) ProtoMessage() {} +func (*Index) Descriptor() ([]byte, []int) { + return fileDescriptor_ef0691a44d1e275c, []int{13} +} + +func (m *Index) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Index.Unmarshal(m, b) +} +func (m *Index) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Index.Marshal(b, m, deterministic) +} +func (m *Index) XXX_Merge(src proto.Message) { + xxx_messageInfo_Index.Merge(m, src) +} +func (m *Index) XXX_Size() int { + return xxx_messageInfo_Index.Size(m) +} +func (m *Index) XXX_DiscardUnknown() { + xxx_messageInfo_Index.DiscardUnknown(m) +} + +var xxx_messageInfo_Index proto.InternalMessageInfo + +func (m *Index) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type CreateIndexRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Keys bool `protobuf:"varint,2,opt,name=keys,proto3" json:"keys,omitempty"` + TrackExistence bool `protobuf:"varint,3,opt,name=trackExistence,proto3" json:"trackExistence,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateIndexRequest) Reset() { *m = CreateIndexRequest{} } +func (m *CreateIndexRequest) String() string { return proto.CompactTextString(m) } +func (*CreateIndexRequest) ProtoMessage() {} +func (*CreateIndexRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ef0691a44d1e275c, []int{14} +} + +func (m *CreateIndexRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateIndexRequest.Unmarshal(m, b) +} +func (m *CreateIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateIndexRequest.Marshal(b, m, deterministic) +} +func (m *CreateIndexRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateIndexRequest.Merge(m, src) +} +func (m *CreateIndexRequest) XXX_Size() int { + return xxx_messageInfo_CreateIndexRequest.Size(m) +} +func (m *CreateIndexRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateIndexRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateIndexRequest proto.InternalMessageInfo + +func (m *CreateIndexRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CreateIndexRequest) GetKeys() bool { + if m != nil { + return m.Keys + } + return false +} + +func (m *CreateIndexRequest) GetTrackExistence() bool { + if m != nil { + return m.TrackExistence + } + return false +} + +type CreateIndexResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateIndexResponse) Reset() { *m = CreateIndexResponse{} } +func (m *CreateIndexResponse) String() string { return proto.CompactTextString(m) } +func (*CreateIndexResponse) ProtoMessage() {} +func (*CreateIndexResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ef0691a44d1e275c, []int{15} +} + +func (m *CreateIndexResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateIndexResponse.Unmarshal(m, b) +} +func (m *CreateIndexResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateIndexResponse.Marshal(b, m, deterministic) +} +func (m *CreateIndexResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateIndexResponse.Merge(m, src) +} +func (m *CreateIndexResponse) XXX_Size() int { + return xxx_messageInfo_CreateIndexResponse.Size(m) +} +func (m *CreateIndexResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CreateIndexResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateIndexResponse proto.InternalMessageInfo + +type GetIndexRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetIndexRequest) Reset() { *m = GetIndexRequest{} } +func (m *GetIndexRequest) String() string { return proto.CompactTextString(m) } +func (*GetIndexRequest) ProtoMessage() {} +func (*GetIndexRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ef0691a44d1e275c, []int{16} +} + +func (m *GetIndexRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetIndexRequest.Unmarshal(m, b) +} +func (m *GetIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetIndexRequest.Marshal(b, m, deterministic) +} +func (m *GetIndexRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetIndexRequest.Merge(m, src) +} +func (m *GetIndexRequest) XXX_Size() int { + return xxx_messageInfo_GetIndexRequest.Size(m) +} +func (m *GetIndexRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetIndexRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetIndexRequest proto.InternalMessageInfo + +func (m *GetIndexRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type GetIndexResponse struct { + Index *Index `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetIndexResponse) Reset() { *m = GetIndexResponse{} } +func (m *GetIndexResponse) String() string { return proto.CompactTextString(m) } +func (*GetIndexResponse) ProtoMessage() {} +func (*GetIndexResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ef0691a44d1e275c, []int{17} +} + +func (m *GetIndexResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetIndexResponse.Unmarshal(m, b) +} +func (m *GetIndexResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetIndexResponse.Marshal(b, m, deterministic) +} +func (m *GetIndexResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetIndexResponse.Merge(m, src) +} +func (m *GetIndexResponse) XXX_Size() int { + return xxx_messageInfo_GetIndexResponse.Size(m) +} +func (m *GetIndexResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetIndexResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetIndexResponse proto.InternalMessageInfo + +func (m *GetIndexResponse) GetIndex() *Index { + if m != nil { + return m.Index + } + return nil +} + +type GetIndexesRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetIndexesRequest) Reset() { *m = GetIndexesRequest{} } +func (m *GetIndexesRequest) String() string { return proto.CompactTextString(m) } +func (*GetIndexesRequest) ProtoMessage() {} +func (*GetIndexesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ef0691a44d1e275c, []int{18} +} + +func (m *GetIndexesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetIndexesRequest.Unmarshal(m, b) +} +func (m *GetIndexesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetIndexesRequest.Marshal(b, m, deterministic) +} +func (m *GetIndexesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetIndexesRequest.Merge(m, src) +} +func (m *GetIndexesRequest) XXX_Size() int { + return xxx_messageInfo_GetIndexesRequest.Size(m) +} +func (m *GetIndexesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetIndexesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetIndexesRequest proto.InternalMessageInfo + +type GetIndexesResponse struct { + Indexes []*Index `protobuf:"bytes,1,rep,name=indexes,proto3" json:"indexes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetIndexesResponse) Reset() { *m = GetIndexesResponse{} } +func (m *GetIndexesResponse) String() string { return proto.CompactTextString(m) } +func (*GetIndexesResponse) ProtoMessage() {} +func (*GetIndexesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ef0691a44d1e275c, []int{19} +} + +func (m *GetIndexesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetIndexesResponse.Unmarshal(m, b) +} +func (m *GetIndexesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetIndexesResponse.Marshal(b, m, deterministic) +} +func (m *GetIndexesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetIndexesResponse.Merge(m, src) +} +func (m *GetIndexesResponse) XXX_Size() int { + return xxx_messageInfo_GetIndexesResponse.Size(m) +} +func (m *GetIndexesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetIndexesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetIndexesResponse proto.InternalMessageInfo + +func (m *GetIndexesResponse) GetIndexes() []*Index { + if m != nil { + return m.Indexes + } + return nil +} + +type DeleteIndexRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteIndexRequest) Reset() { *m = DeleteIndexRequest{} } +func (m *DeleteIndexRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteIndexRequest) ProtoMessage() {} +func (*DeleteIndexRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ef0691a44d1e275c, []int{20} +} + +func (m *DeleteIndexRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteIndexRequest.Unmarshal(m, b) +} +func (m *DeleteIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteIndexRequest.Marshal(b, m, deterministic) +} +func (m *DeleteIndexRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteIndexRequest.Merge(m, src) +} +func (m *DeleteIndexRequest) XXX_Size() int { + return xxx_messageInfo_DeleteIndexRequest.Size(m) +} +func (m *DeleteIndexRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteIndexRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteIndexRequest proto.InternalMessageInfo + +func (m *DeleteIndexRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type DeleteIndexResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteIndexResponse) Reset() { *m = DeleteIndexResponse{} } +func (m *DeleteIndexResponse) String() string { return proto.CompactTextString(m) } +func (*DeleteIndexResponse) ProtoMessage() {} +func (*DeleteIndexResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ef0691a44d1e275c, []int{21} +} + +func (m *DeleteIndexResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteIndexResponse.Unmarshal(m, b) +} +func (m *DeleteIndexResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteIndexResponse.Marshal(b, m, deterministic) +} +func (m *DeleteIndexResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteIndexResponse.Merge(m, src) +} +func (m *DeleteIndexResponse) XXX_Size() int { + return xxx_messageInfo_DeleteIndexResponse.Size(m) +} +func (m *DeleteIndexResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteIndexResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteIndexResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*QueryPQLRequest)(nil), "pilosa.QueryPQLRequest") proto.RegisterType((*QuerySQLRequest)(nil), "pilosa.QuerySQLRequest") @@ -852,60 +1195,81 @@ func init() { proto.RegisterType((*Uint64Array)(nil), "pilosa.Uint64Array") proto.RegisterType((*StringArray)(nil), "pilosa.StringArray") proto.RegisterType((*IdsOrKeys)(nil), "pilosa.IdsOrKeys") + proto.RegisterType((*Index)(nil), "pilosa.Index") + proto.RegisterType((*CreateIndexRequest)(nil), "pilosa.CreateIndexRequest") + proto.RegisterType((*CreateIndexResponse)(nil), "pilosa.CreateIndexResponse") + proto.RegisterType((*GetIndexRequest)(nil), "pilosa.GetIndexRequest") + proto.RegisterType((*GetIndexResponse)(nil), "pilosa.GetIndexResponse") + proto.RegisterType((*GetIndexesRequest)(nil), "pilosa.GetIndexesRequest") + proto.RegisterType((*GetIndexesResponse)(nil), "pilosa.GetIndexesResponse") + proto.RegisterType((*DeleteIndexRequest)(nil), "pilosa.DeleteIndexRequest") + proto.RegisterType((*DeleteIndexResponse)(nil), "pilosa.DeleteIndexResponse") } func init() { proto.RegisterFile("pilosa.proto", fileDescriptor_ef0691a44d1e275c) } var fileDescriptor_ef0691a44d1e275c = []byte{ - // 761 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x72, 0xd3, 0x48, - 0x10, 0xb6, 0x22, 0xc5, 0xb6, 0xda, 0xf9, 0xdb, 0xc9, 0x6e, 0x56, 0x95, 0xda, 0xda, 0x55, 0x94, - 0xc3, 0x7a, 0x6b, 0xb7, 0x92, 0xac, 0x77, 0x03, 0x05, 0x84, 0x43, 0x12, 0xa0, 0x9c, 0x02, 0x0a, - 0x67, 0x42, 0x72, 0xe0, 0x36, 0xb6, 0xc6, 0x8e, 0x8a, 0xb1, 0xc6, 0xd6, 0x48, 0x09, 0x7e, 0x01, - 0xde, 0x87, 0x33, 0x17, 0x4e, 0x3c, 0x17, 0x35, 0x33,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, 0x4a, 0xfb, - 0xdc, 0xe1, 0x90, 0x0c, 0xf4, 0x17, 0x38, 0xaf, 0xe9, 0xc4, 0xdc, 0xc6, 0x9c, 0x39, 0x50, 0x94, - 0xa3, 0x2a, 0x38, 0xf2, 0xb1, 0xb4, 0x3e, 0x2e, 0x40, 0xb5, 0xa3, 0x68, 0xe8, 0x00, 0xea, 0x66, - 0x0f, 0xa3, 0x5f, 0x4d, 0xec, 0x8d, 0xcd, 0xbc, 0xb9, 0x3e, 0xbb, 0x00, 0xf2, 0xe7, 0x15, 0x54, - 0xf6, 0x2c, 0x74, 0x08, 0xcb, 0x86, 0x7b, 0x1e, 0x93, 0x64, 0x32, 0x3f, 0xc5, 0x2f, 0x06, 0x28, - 0xad, 0xa5, 0xa0, 0x52, 0x14, 0xd0, 0xf9, 0xac, 0x80, 0xce, 0x37, 0x14, 0xd0, 0xf9, 0x72, 0x01, - 0x9d, 0x5b, 0x14, 0x70, 0x1f, 0x6a, 0xf9, 0xe0, 0xa1, 0x62, 0xaf, 0x96, 0x27, 0x71, 0xee, 0xe7, - 0x8f, 0xb6, 0x5f, 0x6d, 0x0d, 0xa2, 0xf4, 0x32, 0xeb, 0xee, 0xf4, 0xf8, 0x70, 0x57, 0x93, 0xcc, - 0xcf, 0x55, 0x6b, 0x57, 0xfd, 0x5b, 0x76, 0xab, 0xea, 0xe7, 0xbf, 0x4f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x18, 0x84, 0x1c, 0xb4, 0x44, 0x07, 0x00, 0x00, + // 945 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xdd, 0x72, 0x1b, 0x35, + 0x14, 0xf6, 0x76, 0x37, 0xfe, 0x39, 0x9b, 0xbf, 0x2a, 0x34, 0x2c, 0x2e, 0x03, 0xae, 0x32, 0x50, + 0x33, 0x30, 0x69, 0x31, 0x94, 0x0e, 0xd0, 0x0e, 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ference imports to suppress errors if they are not otherwise used. @@ -920,6 +1284,10 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type PilosaClient interface { + CreateIndex(ctx context.Context, in *CreateIndexRequest, opts ...grpc.CallOption) (*CreateIndexResponse, error) + GetIndexes(ctx context.Context, in *GetIndexesRequest, opts ...grpc.CallOption) (*GetIndexesResponse, error) + GetIndex(ctx context.Context, in *GetIndexRequest, opts ...grpc.CallOption) (*GetIndexResponse, error) + DeleteIndex(ctx context.Context, in *DeleteIndexRequest, opts ...grpc.CallOption) (*DeleteIndexResponse, error) QuerySQL(ctx context.Context, in *QuerySQLRequest, opts ...grpc.CallOption) (Pilosa_QuerySQLClient, error) QuerySQLUnary(ctx context.Context, in *QuerySQLRequest, opts ...grpc.CallOption) (*TableResponse, error) QueryPQL(ctx context.Context, in *QueryPQLRequest, opts ...grpc.CallOption) (Pilosa_QueryPQLClient, error) @@ -935,6 +1303,42 @@ func NewPilosaClient(cc *grpc.ClientConn) PilosaClient { return &pilosaClient{cc} } +func (c *pilosaClient) CreateIndex(ctx context.Context, in *CreateIndexRequest, opts ...grpc.CallOption) (*CreateIndexResponse, error) { + out := new(CreateIndexResponse) + err := c.cc.Invoke(ctx, "/pilosa.Pilosa/CreateIndex", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pilosaClient) GetIndexes(ctx context.Context, in *GetIndexesRequest, opts ...grpc.CallOption) (*GetIndexesResponse, error) { + out := new(GetIndexesResponse) + err := c.cc.Invoke(ctx, "/pilosa.Pilosa/GetIndexes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pilosaClient) GetIndex(ctx context.Context, in *GetIndexRequest, opts ...grpc.CallOption) (*GetIndexResponse, error) { + out := new(GetIndexResponse) + err := c.cc.Invoke(ctx, "/pilosa.Pilosa/GetIndex", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pilosaClient) DeleteIndex(ctx context.Context, in *DeleteIndexRequest, opts ...grpc.CallOption) (*DeleteIndexResponse, error) { + out := new(DeleteIndexResponse) + err := c.cc.Invoke(ctx, "/pilosa.Pilosa/DeleteIndex", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *pilosaClient) QuerySQL(ctx context.Context, in *QuerySQLRequest, opts ...grpc.CallOption) (Pilosa_QuerySQLClient, error) { stream, err := c.cc.NewStream(ctx, &_Pilosa_serviceDesc.Streams[0], "/pilosa.Pilosa/QuerySQL", opts...) if err != nil { @@ -1051,6 +1455,10 @@ func (x *pilosaInspectClient) Recv() (*RowResponse, error) { // PilosaServer is the server API for Pilosa service. type PilosaServer interface { + CreateIndex(context.Context, *CreateIndexRequest) (*CreateIndexResponse, error) + GetIndexes(context.Context, *GetIndexesRequest) (*GetIndexesResponse, error) + GetIndex(context.Context, *GetIndexRequest) (*GetIndexResponse, error) + DeleteIndex(context.Context, *DeleteIndexRequest) (*DeleteIndexResponse, error) QuerySQL(*QuerySQLRequest, Pilosa_QuerySQLServer) error QuerySQLUnary(context.Context, *QuerySQLRequest) (*TableResponse, error) QueryPQL(*QueryPQLRequest, Pilosa_QueryPQLServer) error @@ -1062,6 +1470,18 @@ type PilosaServer interface { type UnimplementedPilosaServer struct { } +func (*UnimplementedPilosaServer) CreateIndex(ctx context.Context, req *CreateIndexRequest) (*CreateIndexResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateIndex not implemented") +} +func (*UnimplementedPilosaServer) GetIndexes(ctx context.Context, req *GetIndexesRequest) (*GetIndexesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetIndexes not implemented") +} +func (*UnimplementedPilosaServer) GetIndex(ctx context.Context, req *GetIndexRequest) (*GetIndexResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetIndex not implemented") +} +func (*UnimplementedPilosaServer) DeleteIndex(ctx context.Context, req *DeleteIndexRequest) (*DeleteIndexResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteIndex not implemented") +} func (*UnimplementedPilosaServer) QuerySQL(req *QuerySQLRequest, srv Pilosa_QuerySQLServer) error { return status.Errorf(codes.Unimplemented, "method QuerySQL not implemented") } @@ -1082,6 +1502,78 @@ func RegisterPilosaServer(s *grpc.Server, srv PilosaServer) { s.RegisterService(&_Pilosa_serviceDesc, srv) } +func _Pilosa_CreateIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PilosaServer).CreateIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pilosa.Pilosa/CreateIndex", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PilosaServer).CreateIndex(ctx, req.(*CreateIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pilosa_GetIndexes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetIndexesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PilosaServer).GetIndexes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pilosa.Pilosa/GetIndexes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PilosaServer).GetIndexes(ctx, req.(*GetIndexesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pilosa_GetIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PilosaServer).GetIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pilosa.Pilosa/GetIndex", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PilosaServer).GetIndex(ctx, req.(*GetIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Pilosa_DeleteIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PilosaServer).DeleteIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pilosa.Pilosa/DeleteIndex", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PilosaServer).DeleteIndex(ctx, req.(*DeleteIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Pilosa_QuerySQL_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(QuerySQLRequest) if err := stream.RecvMsg(m); err != nil { @@ -1185,6 +1677,22 @@ var _Pilosa_serviceDesc = grpc.ServiceDesc{ ServiceName: "pilosa.Pilosa", HandlerType: (*PilosaServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "CreateIndex", + Handler: _Pilosa_CreateIndex_Handler, + }, + { + MethodName: "GetIndexes", + Handler: _Pilosa_GetIndexes_Handler, + }, + { + MethodName: "GetIndex", + Handler: _Pilosa_GetIndex_Handler, + }, + { + MethodName: "DeleteIndex", + Handler: _Pilosa_DeleteIndex_Handler, + }, { MethodName: "QuerySQLUnary", Handler: _Pilosa_QuerySQLUnary_Handler, diff --git a/proto/pilosa.proto b/proto/pilosa.proto index 898614478..fdfa4b352 100644 --- a/proto/pilosa.proto +++ b/proto/pilosa.proto @@ -85,7 +85,46 @@ message IdsOrKeys { } } +message Index { + string name = 1; +} + +message CreateIndexRequest { + string name = 1; + bool keys = 2; + bool trackExistence = 3; +} + +message CreateIndexResponse { +} + +message GetIndexRequest { + string name = 1; +} + +message GetIndexResponse { + Index index = 1; +} + +message GetIndexesRequest { +} + +message GetIndexesResponse { + repeated Index indexes = 1; +} + +message DeleteIndexRequest { + string name = 1; +} + +message DeleteIndexResponse { +} + service Pilosa { + rpc CreateIndex(CreateIndexRequest) returns (CreateIndexResponse) {}; + rpc GetIndexes(GetIndexesRequest) returns (GetIndexesResponse) {}; + rpc GetIndex(GetIndexRequest) returns (GetIndexResponse) {}; + rpc DeleteIndex(DeleteIndexRequest) returns (DeleteIndexResponse) {}; rpc QuerySQL(QuerySQLRequest) returns (stream RowResponse) {}; rpc QuerySQLUnary(QuerySQLRequest) returns (TableResponse) {}; rpc QueryPQL(QueryPQLRequest) returns (stream RowResponse) {}; diff --git a/server/grpc.go b/server/grpc.go index d8544ed97..722583d6a 100644 --- a/server/grpc.go +++ b/server/grpc.go @@ -267,6 +267,46 @@ func (h *GRPCHandler) QueryPQLUnary(ctx context.Context, req *pb.QueryPQLRequest return table, errToStatusError(nil) } +// CreateIndex creates a new Index +func (h *GRPCHandler) CreateIndex(ctx context.Context, req *pb.CreateIndexRequest) (*pb.CreateIndexResponse, error) { + opts := pilosa.IndexOptions{Keys: req.Keys, TrackExistence: req.TrackExistence} + _, err := h.api.CreateIndex(ctx, req.Name, opts) + if err != nil { + return nil, errToStatusError(err) + } + return &pb.CreateIndexResponse{}, nil +} + +// GetIndexes returns a single Index given a name +func (h *GRPCHandler) GetIndex(ctx context.Context, req *pb.GetIndexRequest) (*pb.GetIndexResponse, error) { + schema := h.api.Schema(ctx) + for _, index := range schema { + if req.Name == index.Name { + return &pb.GetIndexResponse{Index: &pb.Index{Name: index.Name}}, nil + } + } + return nil, status.Error(codes.NotFound, fmt.Sprintf("Index with name %s not found", req.Name)) +} + +// GetIndexes returns a list of all Indexes +func (h *GRPCHandler) GetIndexes(ctx context.Context, req *pb.GetIndexesRequest) (*pb.GetIndexesResponse, error) { + schema := h.api.Schema(ctx) + indexes := make([]*pb.Index, len(schema)) + for i, index := range schema { + indexes[i] = &pb.Index{Name: index.Name} + } + return &pb.GetIndexesResponse{Indexes: indexes}, nil +} + +// DeleteIndex deletes an Index +func (h *GRPCHandler) DeleteIndex(ctx context.Context, req *pb.DeleteIndexRequest) (*pb.DeleteIndexResponse, error) { + err := h.api.DeleteIndex(ctx, req.Name) + if err != nil { + return nil, errToStatusError(err) + } + return &pb.DeleteIndexResponse{}, nil +} + // VDSMGRPCHandler contains methods which handle the various gRPC requests, ported from VDSM. type VDSMGRPCHandler struct { grpcHandler *GRPCHandler