task

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxCountInBuf  = 1 << 27
	MaxParallelism = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit added in v0.5.0

type Commit struct {
	// contains filtered or unexported fields
}

type Consumer added in v0.5.0

type Consumer struct {
	// contains filtered or unexported fields
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

TaskService holds the configuration for each task

func NewTaskService

func NewTaskService(cfg *config.Config, taskCfg *config.TaskConfig, c *Consumer) (service *Service)

NewTaskService creates an instance of new tasks with kafka, clickhouse and paser instances

func (*Service) Init

func (service *Service) Init() (err error)

Init initializes the kafka and clickhouse task associated with this service

func (*Service) Put added in v0.5.0

func (service *Service) Put(msg *model.InputMessage, traceId string, flushFn func(traceId, with string)) error

type Sharder

type Sharder struct {
	// contains filtered or unexported fields
}

func NewSharder

func NewSharder(service *Service) (sh *Sharder, err error)

func (*Sharder) Calc

func (sh *Sharder) Calc(row *model.Row) (int, error)

func (*Sharder) Flush added in v0.5.0

func (sh *Sharder) Flush(c context.Context, wg *sync.WaitGroup, rmap map[int32]*model.BatchRange, traceId string)

func (*Sharder) PutElement added in v0.5.0

func (sh *Sharder) PutElement(msgRow *model.MsgRow)

type ShardingPolicy

type ShardingPolicy struct {
	// contains filtered or unexported fields
}

func NewShardingPolicy

func NewShardingPolicy(shardingKey string, shardingStripe uint64, dims []*model.ColumnWithType, shards int) (policy *ShardingPolicy, err error)

func (*ShardingPolicy) Calc

func (policy *ShardingPolicy) Calc(row *model.Row) (shard int, err error)

type Sinker added in v0.5.0

type Sinker struct {
	// contains filtered or unexported fields
}

Sinker object maintains number of task for each partition

func NewSinker added in v0.5.0

func NewSinker(rcm cm.RemoteConfManager, http string, cmd *util.CmdOptions) *Sinker

NewSinker get an instance of sinker with the task list

func (*Sinker) Close added in v0.5.0

func (s *Sinker) Close()

Close shutdown task

func (*Sinker) GetCurrentConfig added in v0.5.0

func (s *Sinker) GetCurrentConfig() *config.Config

func (*Sinker) Init added in v0.5.0

func (s *Sinker) Init() (err error)

func (*Sinker) Run added in v0.5.0

func (s *Sinker) Run()

Run is the mainloop to get and apply config

Jump to

Keyboard shortcuts

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