[skip ci] Add comment for datanode meta_service.go (#9036)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2021-10-01 22:25:24 +08:00 committed by GitHub
parent 5b90868e88
commit 109186db9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,7 @@ type metaService struct {
rootCoord types.RootCoord
}
// newMetaService creates a new metaService with provided RootCoord and collectionID
func newMetaService(rc types.RootCoord, collectionID UniqueID) *metaService {
return &metaService{
rootCoord: rc,
@ -40,8 +41,8 @@ func newMetaService(rc types.RootCoord, collectionID UniqueID) *metaService {
}
}
// getCollectionSchema get collection schema with provided collection id at specified timestamp
func (mService *metaService) getCollectionSchema(ctx context.Context, collID UniqueID, timestamp Timestamp) (*schemapb.CollectionSchema, error) {
// fmt.Println("Describing collection", collID)
req := &milvuspb.DescribeCollectionRequest{
Base: &commonpb.MsgBase{
MsgType: commonpb.MsgType_DescribeCollection,
@ -66,6 +67,8 @@ func (mService *metaService) getCollectionSchema(ctx context.Context, collID Uni
return response.GetSchema(), nil
}
// printCollectionStruct util function to print schema data
// used in tests only
func printCollectionStruct(obj *etcdpb.CollectionMeta) {
v := reflect.ValueOf(obj)
v = reflect.Indirect(v)