mirror of https://github.com/milvus-io/milvus.git
80 lines
1.2 KiB
Markdown
80 lines
1.2 KiB
Markdown
|
|
|
|
## 8. Query Node
|
|
|
|
|
|
|
|
#### 8.1 Overview
|
|
|
|
|
|
|
|
|
|
|
|
#### 8.2 Collection Replica
|
|
|
|
$collectionReplica$ contains a in-memory local copy of persistent collections. In common cases, the system has multiple query nodes. Data of a collection will be distributed across all the available query nodes, and each query node's $collectionReplica$ will maintain its own share (only part of the collection).
|
|
Every replica tracks a value called tSafe which is the maximum timestamp that the replica is up-to-date.
|
|
|
|
###### 8.1.1 Collection
|
|
|
|
``` go
|
|
type Collection struct {
|
|
Name string
|
|
Id uint64
|
|
Fields map[string]FieldMeta
|
|
SegmentsId []uint64
|
|
|
|
cCollectionSchema C.CCollectionSchema
|
|
}
|
|
```
|
|
|
|
|
|
|
|
###### 8.1.2 Field Meta
|
|
|
|
```go
|
|
type FieldMeta struct {
|
|
Name string
|
|
Id uint64
|
|
IsPrimaryKey bool
|
|
TypeParams map[string]string
|
|
IndexParams map[string]string
|
|
}
|
|
```
|
|
|
|
|
|
|
|
###### 8.1.3 Segment
|
|
|
|
``` go
|
|
type Segment struct {
|
|
Id uint64
|
|
ParitionName string
|
|
CollectionId uint64
|
|
OpenTime Timestamp
|
|
CloseTime Timestamp
|
|
NumRows uint64
|
|
|
|
cSegment C.CSegmentBase
|
|
}
|
|
```
|
|
|
|
|
|
|
|
#### 8.3 Data Manipulation Service
|
|
|
|
|
|
|
|
```go
|
|
type manipulationService struct {
|
|
ctx context.Context
|
|
pulsarURL string
|
|
fg *flowgraph.TimeTickedFlowGraph
|
|
msgStream *msgstream.PulsarMsgStream
|
|
node *QueryNode
|
|
}
|
|
```
|
|
|
|
|
|
|