milvus/docs/developer_guides/chap09_data_service.md
neza2017 56ab2bda2d Update proto:add partition id
Signed-off-by: neza2017 <yefu.chen@zilliz.com>
2021-01-15 11:53:22 +08:00

2.8 KiB

8. Data Service

8.1 Overview

8.2 Data Service Interface

type DataService interface {
  Service
  
  RegisterNode(req RegisterNodeRequest) (RegisterNodeResponse, error)
  Flush(req FlushRequest) error
  
  AssignSegmentID(req AssignSegIDRequest) (AssignSegIDResponse, error)
  ShowSegments(req ShowSegmentRequest) (ShowSegmentResponse, error)
  GetSegmentStates(req SegmentStatesRequest) (SegmentStatesResponse, error)
  GetInsertBinlogPaths(req InsertBinlogPathRequest) (InsertBinlogPathsResponse, error)
  
  GetInsertChannels(req InsertChannelRequest) ([]string, error)
}
  • RequestBase
type RequestBase struct {
  MsgType MsgType
  ReqID	UniqueID
  Timestamp Timestamp
  RequestorID UniqueID
}
  • RegisterNode
type RegisterNodeRequest struct {
  RequestBase
  Address string
  Port int64
}

type RegisterNodeResponse struct {
  //InitParams
}
  • AssignSegmentID
type SegIDRequest struct {
  Count uint32
  ChannelName string
	CollectionID UniqueID
  PartitionID UniqueID
}

type AssignSegIDRequest struct {
  RequestBase
  PerChannelRequest []SegIDRequest
}

type SegIDAssignment struct {
  SegmentID UniqueID
  ChannelName string
  Count uint32
	CollectionID UniqueID
  PartitionID UniqueID
  ExpireTime Timestamp
}

type AssignSegIDResponse struct {
  PerChannelResponse []SegIDAssignment
}
  • Flush
type FlushRequest struct {
  RequestBase
  DbID UniqueID
  CollectionID UniqueID
}
  • ShowSegments
type ShowSegmentRequest struct {
  RequestBase
  CollectionID UniqueID
  PartitionID UniqueID
}

type ShowSegmentResponse struct {
  SegmentIDs []UniqueID
}
  • GetSegmentStates
enum SegmentState {
    NONE = 0;
    NOT_EXIST = 1;
    GROWING = 2;
    SEALED = 3;
}

type SegmentStatesRequest struct {
  RequestBase
  SegmentID UniqueID
}

type SegmentStatesResponse struct {
  State SegmentState
  CreateTime Timestamp
  SealedTime Timestamp
}
  • GetInsertBinlogPaths
type InsertBinlogPathRequest struct {
  RequestBase
  SegmentID UniqueID
}

type InsertBinlogPathsResponse struct {
  FieldIDToPaths map[int64][]string
}
  • GetInsertChannels
type InsertChannelRequest struct {
  RequestBase
  DbID UniqueID
  CollectionID UniqueID
}

8.2 Data Node Interface

type DataNode interface {
  Service
  
  WatchDmChannels(req WatchDmChannelRequest) error
  //WatchDdChannel(channelName string) error
  //SetTimeTickChannel(channelName string) error
  //SetStatsChannel(channelName string) error
  
  FlushSegments(req FlushSegRequest) error
}
  • WatchDmChannels
type WatchDmChannelRequest struct {
  RequestBase
  InsertChannelNames []string
}
  • FlushSegments
type FlushSegRequest struct {
  RequestBase
  DbID UniqueID
  CollectionID UniqueID
  SegmentID []UniqueID
}