Skip to content

Commit

Permalink
Update proto definition to lastest (#297)
Browse files Browse the repository at this point in the history
Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Jul 22, 2022
1 parent a17f36b commit c3197d1
Show file tree
Hide file tree
Showing 7 changed files with 4,976 additions and 2,140 deletions.
14 changes: 7 additions & 7 deletions client/client_grpc_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,8 @@ func columnToVectorsArray(collName string, partitions []string, column entity.Co
}

func vector2PlaceholderGroupBytes(vectors []entity.Vector, fieldType entity.FieldType) []byte {
phg := &server.PlaceholderGroup{
Placeholders: []*server.PlaceholderValue{
phg := &common.PlaceholderGroup{
Placeholders: []*common.PlaceholderValue{
vector2Placeholder(vectors, fieldType),
},
}
Expand All @@ -701,15 +701,15 @@ func vector2PlaceholderGroupBytes(vectors []entity.Vector, fieldType entity.Fiel
return bs
}

func vector2Placeholder(vectors []entity.Vector, fieldType entity.FieldType) *server.PlaceholderValue {
var placeHolderType server.PlaceholderType
func vector2Placeholder(vectors []entity.Vector, fieldType entity.FieldType) *common.PlaceholderValue {
var placeHolderType common.PlaceholderType
switch fieldType {
case entity.FieldTypeFloatVector:
placeHolderType = server.PlaceholderType_FloatVector
placeHolderType = common.PlaceholderType_FloatVector
case entity.FieldTypeBinaryVector:
placeHolderType = server.PlaceholderType_BinaryVector
placeHolderType = common.PlaceholderType_BinaryVector
}
ph := &server.PlaceholderValue{
ph := &common.PlaceholderValue{
Tag: "$0",
Type: placeHolderType,
Values: make([][]byte, 0, len(vectors)),
Expand Down
4 changes: 2 additions & 2 deletions client/client_grpc_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ func TestVector2PlaceHolder(t *testing.T) {

phv := vector2Placeholder(vectors, entity.FieldTypeFloatVector)
assert.Equal(t, "$0", phv.Tag)
assert.Equal(t, server.PlaceholderType_FloatVector, phv.Type)
assert.Equal(t, common.PlaceholderType_FloatVector, phv.Type)
require.Equal(t, len(vectors), len(phv.Values))
for idx, line := range phv.Values {
assert.Equal(t, vectors[idx].Serialize(), line)
Expand All @@ -1091,7 +1091,7 @@ func TestVector2PlaceHolder(t *testing.T) {

phv := vector2Placeholder(vectors, entity.FieldTypeBinaryVector)
assert.Equal(t, "$0", phv.Tag)
assert.Equal(t, server.PlaceholderType_BinaryVector, phv.Type)
assert.Equal(t, common.PlaceholderType_BinaryVector, phv.Type)
require.Equal(t, len(vectors), len(phv.Values))
for idx, line := range phv.Values {
assert.Equal(t, vectors[idx].Serialize(), line)
Expand Down
33 changes: 33 additions & 0 deletions client/client_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -664,3 +664,36 @@ func (m *mockServer) ListCredUsers(ctx context.Context, req *server.ListCredUser
resp.Status = s
return resp, err
}

// https://wiki.lfaidata.foundation/display/MIL/MEP+29+--+Support+Role-Based+Access+Control
func (m *mockServer) CreateRole(_ context.Context, _ *server.CreateRoleRequest) (*common.Status, error) {
panic("not implemented") // TODO: Implement
}

func (m *mockServer) DropRole(_ context.Context, _ *server.DropRoleRequest) (*common.Status, error) {
panic("not implemented") // TODO: Implement
}

func (m *mockServer) OperateUserRole(_ context.Context, _ *server.OperateUserRoleRequest) (*common.Status, error) {
panic("not implemented") // TODO: Implement
}

func (m *mockServer) SelectRole(_ context.Context, _ *server.SelectRoleRequest) (*server.SelectRoleResponse, error) {
panic("not implemented") // TODO: Implement
}

func (m *mockServer) SelectUser(_ context.Context, _ *server.SelectUserRequest) (*server.SelectUserResponse, error) {
panic("not implemented") // TODO: Implement
}

func (m *mockServer) SelectResource(_ context.Context, _ *server.SelectResourceRequest) (*server.SelectResourceResponse, error) {
panic("not implemented") // TODO: Implement
}

func (m *mockServer) OperatePrivilege(_ context.Context, _ *server.OperatePrivilegeRequest) (*common.Status, error) {
panic("not implemented") // TODO: Implement
}

func (m *mockServer) SelectGrant(_ context.Context, _ *server.SelectGrantRequest) (*server.SelectGrantResponse, error) {
panic("not implemented") // TODO: Implement
}
2 changes: 1 addition & 1 deletion internal/milvus-proto
Loading

0 comments on commit c3197d1

Please sign in to comment.