diff --git a/internal/datanode/allocator.go b/internal/datanode/allocator.go index ebb6a0bc86..e86bf6cd28 100644 --- a/internal/datanode/allocator.go +++ b/internal/datanode/allocator.go @@ -32,6 +32,7 @@ type allocator struct { rootCoord types.RootCoord } +// check if allocator implements allocatorInterface var _ allocatorInterface = &allocator{} func newAllocator(s types.RootCoord) *allocator { @@ -40,7 +41,7 @@ func newAllocator(s types.RootCoord) *allocator { } } -// allocID allocate one ID from rootCoord +// allocID allocates one ID from rootCoord func (alloc *allocator) allocID() (UniqueID, error) { ctx := context.TODO() resp, err := alloc.rootCoord.AllocID(ctx, &rootcoordpb.AllocIDRequest{ diff --git a/internal/datanode/meta_service.go b/internal/datanode/meta_service.go index 04c68490ee..9b0303496f 100644 --- a/internal/datanode/meta_service.go +++ b/internal/datanode/meta_service.go @@ -33,7 +33,7 @@ type metaService struct { rootCoord types.RootCoord } -// newMetaService creates a new metaService with provided RootCoord and collectionID +// newMetaService creates a new metaService with provided RootCoord and collectionID. func newMetaService(rc types.RootCoord, collectionID UniqueID) *metaService { return &metaService{ rootCoord: rc, @@ -41,7 +41,7 @@ func newMetaService(rc types.RootCoord, collectionID UniqueID) *metaService { } } -// getCollectionSchema get collection schema with provided collection id at specified timestamp +// 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) { req := &milvuspb.DescribeCollectionRequest{ Base: &commonpb.MsgBase{ @@ -67,8 +67,7 @@ func (mService *metaService) getCollectionSchema(ctx context.Context, collID Uni return response.GetSchema(), nil } -// printCollectionStruct util function to print schema data -// used in tests only +// printCollectionStruct util function to print schema data, used in tests only. func printCollectionStruct(obj *etcdpb.CollectionMeta) { v := reflect.ValueOf(obj) v = reflect.Indirect(v)