Documentation ¶
Index ¶
- Variables
- func NewChunkMgrFactory() *chunkMgrFactory
- func NewMockChunkManager() *mockChunkmgr
- func NewMockIndexNodeComponent(ctx context.Context) (types.IndexNodeComponent, error)
- type Blob
- type IndexNode
- func (i *IndexNode) CloseSegcore()
- func (i *IndexNode) CreateJob(ctx context.Context, req *indexpb.CreateJobRequest) (*commonpb.Status, error)
- func (i *IndexNode) CreateJobV2(ctx context.Context, req *indexpb.CreateJobV2Request) (*commonpb.Status, error)
- func (i *IndexNode) DropJobs(ctx context.Context, req *indexpb.DropJobsRequest) (*commonpb.Status, error)
- func (i *IndexNode) DropJobsV2(ctx context.Context, req *indexpb.DropJobsV2Request) (*commonpb.Status, error)
- func (i *IndexNode) GetAddress() string
- func (i *IndexNode) GetComponentStates(ctx context.Context, req *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error)
- func (i *IndexNode) GetJobStats(ctx context.Context, req *indexpb.GetJobStatsRequest) (*indexpb.GetJobStatsResponse, error)
- func (i *IndexNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error)
- func (i *IndexNode) GetNodeID() int64
- func (i *IndexNode) GetStatisticsChannel(ctx context.Context, req *internalpb.GetStatisticsChannelRequest) (*milvuspb.StringResponse, error)
- func (i *IndexNode) GetTimeTickChannel(ctx context.Context, req *internalpb.GetTimeTickChannelRequest) (*milvuspb.StringResponse, error)
- func (i *IndexNode) Init() error
- func (i *IndexNode) QueryJobs(ctx context.Context, req *indexpb.QueryJobsRequest) (*indexpb.QueryJobsResponse, error)
- func (i *IndexNode) QueryJobsV2(ctx context.Context, req *indexpb.QueryJobsV2Request) (*indexpb.QueryJobsV2Response, error)
- func (i *IndexNode) Register() error
- func (i *IndexNode) SetAddress(address string)
- func (i *IndexNode) SetEtcdClient(client *clientv3.Client)
- func (i *IndexNode) ShowConfigurations(ctx context.Context, req *internalpb.ShowConfigurationsRequest) (*internalpb.ShowConfigurationsResponse, error)
- func (i *IndexNode) Start() error
- func (i *IndexNode) Stop() error
- func (i *IndexNode) UpdateStateCode(code commonpb.StateCode)
- type IndexTaskQueue
- type Mock
- func (m *Mock) CreateJob(ctx context.Context, req *indexpb.CreateJobRequest) (*commonpb.Status, error)
- func (m *Mock) CreateJobV2(ctx context.Context, req *indexpb.CreateJobV2Request) (*commonpb.Status, error)
- func (m *Mock) DropJobs(ctx context.Context, req *indexpb.DropJobsRequest) (*commonpb.Status, error)
- func (m *Mock) DropJobsV2(ctx context.Context, req *indexpb.DropJobsV2Request) (*commonpb.Status, error)
- func (m *Mock) GetAddress() string
- func (m *Mock) GetComponentStates(ctx context.Context, req *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error)
- func (m *Mock) GetJobStats(ctx context.Context, req *indexpb.GetJobStatsRequest) (*indexpb.GetJobStatsResponse, error)
- func (m *Mock) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error)
- func (m *Mock) GetStatisticsChannel(ctx context.Context, req *internalpb.GetStatisticsChannelRequest) (*milvuspb.StringResponse, error)
- func (m *Mock) Init() error
- func (m *Mock) QueryJobs(ctx context.Context, req *indexpb.QueryJobsRequest) (*indexpb.QueryJobsResponse, error)
- func (m *Mock) QueryJobsV2(ctx context.Context, req *indexpb.QueryJobsV2Request) (*indexpb.QueryJobsV2Response, error)
- func (m *Mock) Register() error
- func (m *Mock) SetAddress(address string)
- func (m *Mock) SetEtcdClient(etcdClient *clientv3.Client)
- func (m *Mock) ShowConfigurations(ctx context.Context, req *internalpb.ShowConfigurationsRequest) (*internalpb.ShowConfigurationsResponse, error)
- func (m *Mock) Start() error
- func (m *Mock) Stop() error
- func (m *Mock) UpdateStateCode(stateCode commonpb.StateCode)
- type StorageFactory
- type TaskQueue
- type TaskScheduler
- type TaskState
- type UniqueID
Constants ¶
This section is empty.
Variables ¶
var Params *paramtable.ComponentParam = paramtable.Get()
Params is a GlobalParamTable singleton of indexnode
var TaskStateNames = map[TaskState]string{
0: "Normal",
1: "Abandon",
2: "Retry",
3: "Failed",
}
Functions ¶
func NewChunkMgrFactory ¶
func NewChunkMgrFactory() *chunkMgrFactory
func NewMockChunkManager ¶
func NewMockChunkManager() *mockChunkmgr
func NewMockIndexNodeComponent ¶
func NewMockIndexNodeComponent(ctx context.Context) (types.IndexNodeComponent, error)
Types ¶
type IndexNode ¶
type IndexNode struct {
// contains filtered or unexported fields
}
IndexNode is a component that executes the task of building indexes.
func NewIndexNode ¶
func NewIndexNode(ctx context.Context, factory dependency.Factory) *IndexNode
NewIndexNode creates a new IndexNode component.
func (*IndexNode) CloseSegcore ¶
func (i *IndexNode) CloseSegcore()
func (*IndexNode) CreateJobV2 ¶
func (*IndexNode) DropJobsV2 ¶
func (*IndexNode) GetAddress ¶
func (*IndexNode) GetComponentStates ¶
func (i *IndexNode) GetComponentStates(ctx context.Context, req *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error)
GetComponentStates gets the component states of IndexNode.
func (*IndexNode) GetJobStats ¶
func (i *IndexNode) GetJobStats(ctx context.Context, req *indexpb.GetJobStatsRequest) (*indexpb.GetJobStatsResponse, error)
GetJobStats should be GetSlots
func (*IndexNode) GetMetrics ¶
func (i *IndexNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error)
GetMetrics gets the metrics info of IndexNode. TODO(dragondriver): cache the Metrics and set a retention to the cache
func (*IndexNode) GetStatisticsChannel ¶
func (i *IndexNode) GetStatisticsChannel(ctx context.Context, req *internalpb.GetStatisticsChannelRequest) (*milvuspb.StringResponse, error)
GetStatisticsChannel gets the statistics channel of IndexNode.
func (*IndexNode) GetTimeTickChannel ¶
func (i *IndexNode) GetTimeTickChannel(ctx context.Context, req *internalpb.GetTimeTickChannelRequest) (*milvuspb.StringResponse, error)
GetTimeTickChannel gets the time tick channel of IndexNode.
func (*IndexNode) QueryJobs ¶
func (i *IndexNode) QueryJobs(ctx context.Context, req *indexpb.QueryJobsRequest) (*indexpb.QueryJobsResponse, error)
func (*IndexNode) QueryJobsV2 ¶
func (i *IndexNode) QueryJobsV2(ctx context.Context, req *indexpb.QueryJobsV2Request) (*indexpb.QueryJobsV2Response, error)
func (*IndexNode) SetAddress ¶
func (*IndexNode) SetEtcdClient ¶
SetEtcdClient assigns parameter client to its member etcdCli
func (*IndexNode) ShowConfigurations ¶
func (i *IndexNode) ShowConfigurations(ctx context.Context, req *internalpb.ShowConfigurationsRequest) (*internalpb.ShowConfigurationsResponse, error)
ShowConfigurations returns the configurations of indexNode matching req.Pattern
func (*IndexNode) UpdateStateCode ¶
UpdateStateCode updates the component state of IndexNode.
type IndexTaskQueue ¶
type IndexTaskQueue struct {
// contains filtered or unexported fields
}
BaseTaskQueue is a basic instance of TaskQueue.
func NewIndexBuildTaskQueue ¶
func NewIndexBuildTaskQueue(sched *TaskScheduler) *IndexTaskQueue
NewIndexBuildTaskQueue creates a new IndexBuildTaskQueue.
func (*IndexTaskQueue) AddActiveTask ¶
func (queue *IndexTaskQueue) AddActiveTask(t task)
AddActiveTask adds a task to activeTasks.
func (*IndexTaskQueue) Enqueue ¶
func (queue *IndexTaskQueue) Enqueue(t task) error
Enqueue adds a task to TaskQueue.
func (*IndexTaskQueue) GetTaskNum ¶
func (queue *IndexTaskQueue) GetTaskNum() (int, int)
func (*IndexTaskQueue) PopActiveTask ¶
func (queue *IndexTaskQueue) PopActiveTask(tName string) task
PopActiveTask pops a task from activateTask and the task will be executed.
func (*IndexTaskQueue) PopUnissuedTask ¶
func (queue *IndexTaskQueue) PopUnissuedTask() task
PopUnissuedTask pops a task from tasks queue.
type Mock ¶
type Mock struct { types.IndexNode CallInit func() error CallStart func() error CallStop func() error CallGetComponentStates func(ctx context.Context) (*milvuspb.ComponentStates, error) CallGetStatisticsChannel func(ctx context.Context) (*milvuspb.StringResponse, error) CallRegister func() error CallSetAddress func(address string) CallSetEtcdClient func(etcdClient *clientv3.Client) CallUpdateStateCode func(stateCode commonpb.StateCode) CallCreateJob func(ctx context.Context, req *indexpb.CreateJobRequest) (*commonpb.Status, error) CallQueryJobs func(ctx context.Context, in *indexpb.QueryJobsRequest) (*indexpb.QueryJobsResponse, error) CallDropJobs func(ctx context.Context, in *indexpb.DropJobsRequest) (*commonpb.Status, error) CallGetJobStats func(ctx context.Context, in *indexpb.GetJobStatsRequest) (*indexpb.GetJobStatsResponse, error) CallCreateJobV2 func(ctx context.Context, req *indexpb.CreateJobV2Request) (*commonpb.Status, error) CallQueryJobV2 func(ctx context.Context, req *indexpb.QueryJobsV2Request) (*indexpb.QueryJobsV2Response, error) CallDropJobV2 func(ctx context.Context, req *indexpb.DropJobsV2Request) (*commonpb.Status, error) CallGetMetrics func(ctx context.Context, req *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) CallShowConfigurations func(ctx context.Context, req *internalpb.ShowConfigurationsRequest) (*internalpb.ShowConfigurationsResponse, error) }
Mock is an alternative to IndexNode, it will return specific results based on specific parameters.
func NewIndexNodeMock ¶
func NewIndexNodeMock() *Mock
func (*Mock) CreateJobV2 ¶
func (*Mock) DropJobsV2 ¶
func (*Mock) GetAddress ¶
func (*Mock) GetComponentStates ¶
func (m *Mock) GetComponentStates(ctx context.Context, req *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error)
func (*Mock) GetJobStats ¶
func (m *Mock) GetJobStats(ctx context.Context, req *indexpb.GetJobStatsRequest) (*indexpb.GetJobStatsResponse, error)
func (*Mock) GetMetrics ¶
func (m *Mock) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error)
func (*Mock) GetStatisticsChannel ¶
func (m *Mock) GetStatisticsChannel(ctx context.Context, req *internalpb.GetStatisticsChannelRequest) (*milvuspb.StringResponse, error)
func (*Mock) QueryJobs ¶
func (m *Mock) QueryJobs(ctx context.Context, req *indexpb.QueryJobsRequest) (*indexpb.QueryJobsResponse, error)
func (*Mock) QueryJobsV2 ¶
func (m *Mock) QueryJobsV2(ctx context.Context, req *indexpb.QueryJobsV2Request) (*indexpb.QueryJobsV2Response, error)
func (*Mock) SetAddress ¶
func (*Mock) SetEtcdClient ¶
func (*Mock) ShowConfigurations ¶
func (m *Mock) ShowConfigurations(ctx context.Context, req *internalpb.ShowConfigurationsRequest) (*internalpb.ShowConfigurationsResponse, error)
ShowConfigurations returns the configurations of Mock indexNode matching req.Pattern
func (*Mock) UpdateStateCode ¶
type StorageFactory ¶
type StorageFactory interface {
NewChunkManager(ctx context.Context, config *indexpb.StorageConfig) (storage.ChunkManager, error)
}
type TaskQueue ¶
type TaskQueue interface { PopUnissuedTask() task AddActiveTask(t task) PopActiveTask(tName string) task Enqueue(t task) error GetTaskNum() (int, int) // contains filtered or unexported methods }
TaskQueue is a queue used to store tasks.
type TaskScheduler ¶
type TaskScheduler struct { TaskQueue TaskQueue // contains filtered or unexported fields }
TaskScheduler is a scheduler of indexing tasks.
func NewTaskScheduler ¶
func NewTaskScheduler(ctx context.Context) *TaskScheduler
NewTaskScheduler creates a new task scheduler of indexing tasks.
func (*TaskScheduler) Close ¶
func (sched *TaskScheduler) Close()
Close closes the task scheduler of indexing tasks.
func (*TaskScheduler) Start ¶
func (sched *TaskScheduler) Start() error
Start stats the task scheduler of indexing tasks.