indexnode

package
v0.10.3-0...-6b23e66 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 68 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Params is a GlobalParamTable singleton of indexnode

View Source
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 Blob

type Blob = storage.Blob

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) CreateJob

func (i *IndexNode) CreateJob(ctx context.Context, req *workerpb.CreateJobRequest) (*commonpb.Status, error)

func (*IndexNode) CreateJobV2

func (i *IndexNode) CreateJobV2(ctx context.Context, req *workerpb.CreateJobV2Request) (*commonpb.Status, error)

func (*IndexNode) DropJobs

func (*IndexNode) DropJobsV2

func (i *IndexNode) DropJobsV2(ctx context.Context, req *workerpb.DropJobsV2Request) (*commonpb.Status, error)

func (*IndexNode) GetAddress

func (i *IndexNode) GetAddress() string

func (*IndexNode) GetComponentStates

GetComponentStates gets the component states of IndexNode.

func (*IndexNode) GetJobStats

GetJobStats should be GetSlots

func (*IndexNode) GetMetrics

GetMetrics gets the metrics info of IndexNode. TODO(dragondriver): cache the Metrics and set a retention to the cache

func (*IndexNode) GetNodeID

func (i *IndexNode) GetNodeID() int64

func (*IndexNode) GetStatisticsChannel

GetStatisticsChannel gets the statistics channel of IndexNode.

func (*IndexNode) GetTimeTickChannel

GetTimeTickChannel gets the time tick channel of IndexNode.

func (*IndexNode) Init

func (i *IndexNode) Init() error

Init initializes the IndexNode component.

func (*IndexNode) QueryJobs

func (*IndexNode) QueryJobsV2

func (*IndexNode) Register

func (i *IndexNode) Register() error

Register register index node at etcd.

func (*IndexNode) SetAddress

func (i *IndexNode) SetAddress(address string)

func (*IndexNode) SetEtcdClient

func (i *IndexNode) SetEtcdClient(client *clientv3.Client)

SetEtcdClient assigns parameter client to its member etcdCli

func (*IndexNode) ShowConfigurations

ShowConfigurations returns the configurations of indexNode matching req.Pattern

func (*IndexNode) Start

func (i *IndexNode) Start() error

Start starts the IndexNode component.

func (*IndexNode) Stop

func (i *IndexNode) Stop() error

Stop closes the server.

func (*IndexNode) UpdateStateCode

func (i *IndexNode) UpdateStateCode(code commonpb.StateCode)

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 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.

type TaskState

type TaskState int32
const (
	TaskStateNormal  TaskState = 0
	TaskStateAbandon TaskState = 1
	TaskStateRetry   TaskState = 2
	TaskStateFailed  TaskState = 3
)

func (TaskState) String

func (x TaskState) String() string

type UniqueID

type UniqueID = typeutil.UniqueID

TODO add comments UniqueID is an alias of int64, is used as a unique identifier for the request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL