2021-01-19 11:37:16 +08:00
|
|
|
package datanode
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/zilliztech/milvus-distributed/internal/proto/schemapb"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Collection struct {
|
|
|
|
schema *schemapb.CollectionSchema
|
|
|
|
id UniqueID
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *Collection) Name() string {
|
|
|
|
return c.schema.Name
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *Collection) ID() UniqueID {
|
|
|
|
return c.id
|
|
|
|
}
|
|
|
|
|
2021-01-22 09:36:40 +08:00
|
|
|
func (c *Collection) Schema() *schemapb.CollectionSchema {
|
|
|
|
return c.schema
|
|
|
|
}
|
|
|
|
|
2021-01-25 18:33:10 +08:00
|
|
|
func newCollection(collectionID UniqueID, schema *schemapb.CollectionSchema) *Collection {
|
2021-01-19 11:37:16 +08:00
|
|
|
var newCollection = &Collection{
|
2021-01-25 18:33:10 +08:00
|
|
|
schema: schema,
|
2021-01-19 11:37:16 +08:00
|
|
|
id: collectionID,
|
|
|
|
}
|
|
|
|
return newCollection
|
|
|
|
}
|