writer

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseTask

type BaseTask struct {
	*plugin.BaseTask
}

BaseTask 基础写入任务,辅助和简化写入任务接口的实现

func NewBaseTask

func NewBaseTask() *BaseTask

NewBaseTask 创建基础任务

func (*BaseTask) SupportFailOver

func (b *BaseTask) SupportFailOver() bool

SupportFailOver 是否支持故障转移,就是是否在写入后失败重试

type Job

type Job interface {
	plugin.Job

	//根据Job进行切分,将原有任务尽量切分成number个任务,主要以配置文件的形式传递给每个任务
	Split(ctx context.Context, number int) ([]*config.JSON, error)
}

Job 工作

type Task

type Task interface {
	plugin.Task

	//开始从receiver中读取记录写入
	StartWrite(ctx context.Context, receiver plugin.RecordReceiver) error
	//是否支持故障转移,就是是否在写入后失败重试
	SupportFailOver() bool
}

Task 写入任务

Jump to

Keyboard shortcuts

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