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