2021-01-16 10:12:14 +08:00
|
|
|
package querynode
|
2020-08-28 17:29:26 +08:00
|
|
|
|
2020-09-02 10:38:08 +08:00
|
|
|
/*
|
|
|
|
|
2020-10-23 18:01:24 +08:00
|
|
|
#cgo CFLAGS: -I${SRCDIR}/../core/output/include
|
2020-09-02 10:38:08 +08:00
|
|
|
|
2020-10-31 15:11:47 +08:00
|
|
|
#cgo LDFLAGS: -L${SRCDIR}/../core/output/lib -lmilvus_segcore -Wl,-rpath=${SRCDIR}/../core/output/lib
|
2020-09-02 10:38:08 +08:00
|
|
|
|
2020-11-25 10:31:51 +08:00
|
|
|
#include "segcore/collection_c.h"
|
|
|
|
#include "segcore/segment_c.h"
|
2020-09-02 10:38:08 +08:00
|
|
|
|
|
|
|
*/
|
2020-08-28 17:29:26 +08:00
|
|
|
import "C"
|
|
|
|
|
|
|
|
type Partition struct {
|
2020-11-09 16:27:11 +08:00
|
|
|
partitionTag string
|
2021-01-20 09:36:50 +08:00
|
|
|
id UniqueID
|
2020-11-09 16:27:11 +08:00
|
|
|
segments []*Segment
|
2020-08-28 17:29:26 +08:00
|
|
|
}
|
|
|
|
|
2021-01-20 09:36:50 +08:00
|
|
|
func (p *Partition) ID() UniqueID {
|
|
|
|
return p.id
|
|
|
|
}
|
|
|
|
|
2020-11-09 16:27:11 +08:00
|
|
|
func (p *Partition) Tag() string {
|
|
|
|
return (*p).partitionTag
|
|
|
|
}
|
2020-08-28 17:29:26 +08:00
|
|
|
|
2020-11-09 16:27:11 +08:00
|
|
|
func (p *Partition) Segments() *[]*Segment {
|
|
|
|
return &(*p).segments
|
2020-08-28 17:29:26 +08:00
|
|
|
}
|
|
|
|
|
2020-11-09 16:27:11 +08:00
|
|
|
func newPartition(partitionTag string) *Partition {
|
|
|
|
var newPartition = &Partition{
|
|
|
|
partitionTag: partitionTag,
|
2020-10-24 10:45:57 +08:00
|
|
|
}
|
|
|
|
|
2020-11-09 16:27:11 +08:00
|
|
|
return newPartition
|
2020-08-28 17:29:26 +08:00
|
|
|
}
|