[skip ci]Fix golint for IndexBuildTask in indexnode.go (#9493)

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
pull/9509/head
cai.zhang 2021-10-09 00:05:49 +08:00 committed by GitHub
parent 1ec153ad9b
commit 3b7b10c18e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -85,6 +85,7 @@ func (bt *BaseTask) Notify(err error) {
bt.done <- err bt.done <- err
} }
// IndexBuildTask is used to record the information of the index tasks.
type IndexBuildTask struct { type IndexBuildTask struct {
BaseTask BaseTask
index Index index Index
@ -95,22 +96,27 @@ type IndexBuildTask struct {
nodeID UniqueID nodeID UniqueID
} }
// Ctx is the context of index tasks.
func (it *IndexBuildTask) Ctx() context.Context { func (it *IndexBuildTask) Ctx() context.Context {
return it.ctx return it.ctx
} }
// ID returns the id of index task.
func (it *IndexBuildTask) ID() UniqueID { func (it *IndexBuildTask) ID() UniqueID {
return it.id return it.id
} }
// SetID sets the id for index task.
func (it *IndexBuildTask) SetID(ID UniqueID) { func (it *IndexBuildTask) SetID(ID UniqueID) {
it.BaseTask.setID(ID) it.BaseTask.setID(ID)
} }
// Name is the name of task to build index.
func (bt *BaseTask) Name() string { func (bt *BaseTask) Name() string {
return IndexBuildTaskName return IndexBuildTaskName
} }
// OnEnqueue enqueues indexing tasks.
func (it *IndexBuildTask) OnEnqueue() error { func (it *IndexBuildTask) OnEnqueue() error {
it.SetID(it.req.IndexBuildID) it.SetID(it.req.IndexBuildID)
log.Debug("IndexNode IndexBuilderTask Enqueue", zap.Int64("TaskID", it.ID())) log.Debug("IndexNode IndexBuilderTask Enqueue", zap.Int64("TaskID", it.ID()))