store

package
v0.0.0-...-34f85fd Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EtcdOpTimeout        = 5 * time.Second
	EtcdOpRetryTime uint = 5
)

Functions

func DeleteTask

func DeleteTask(factory api.MetaStoreFactory, taskID string) (*meta.TaskInfo, error)

// TODO fubang can't delete the task position when delete the task

func DeleteTaskCollectionPosition

func DeleteTaskCollectionPosition(taskPositionStore api.MetaStore[*meta.TaskCollectionPosition], taskID string, collectionID int64) error

func EtcdStatus

func EtcdStatus(ctx context.Context, etcdClient *clientv3.Client) error

func GetAllTaskInfo

func GetAllTaskInfo(taskInfoStore api.MetaStore[*meta.TaskInfo]) ([]*meta.TaskInfo, error)

func GetTaskInfo

func GetTaskInfo(taskInfoStore api.MetaStore[*meta.TaskInfo], taskID string) (*meta.TaskInfo, error)

func UpdateTaskCollectionPosition

func UpdateTaskCollectionPosition(taskPositionStore api.MetaStore[*meta.TaskCollectionPosition], taskID string, collectionID int64, collectionName string, pChannelName string, position, opPosition, targetPosition *meta.PositionInfo) error

func UpdateTaskState

func UpdateTaskState(taskInfoStore api.MetaStore[*meta.TaskInfo], taskID string,
	newState meta.TaskState, oldStates []meta.TaskState, reason string,
) error

Types

type EtcdMetaStore

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

func NewEtcdMetaStore

func NewEtcdMetaStore(ctx context.Context, endpoints []string, rootPath string) (*EtcdMetaStore, error)

func (*EtcdMetaStore) GetTaskCollectionPositionMetaStore

func (e *EtcdMetaStore) GetTaskCollectionPositionMetaStore(ctx context.Context) api.MetaStore[*meta.TaskCollectionPosition]

func (*EtcdMetaStore) GetTaskInfoMetaStore

func (e *EtcdMetaStore) GetTaskInfoMetaStore(ctx context.Context) api.MetaStore[*meta.TaskInfo]

func (*EtcdMetaStore) Txn

func (e *EtcdMetaStore) Txn(ctx context.Context) (any, func(err error) error, error)

type MySQLMetaStore

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

func NewMySQLMetaStore

func NewMySQLMetaStore(ctx context.Context, dataSourceName string, rootPath string) (*MySQLMetaStore, error)

func (*MySQLMetaStore) GetTaskCollectionPositionMetaStore

func (s *MySQLMetaStore) GetTaskCollectionPositionMetaStore(ctx context.Context) api.MetaStore[*meta.TaskCollectionPosition]

func (*MySQLMetaStore) GetTaskInfoMetaStore

func (s *MySQLMetaStore) GetTaskInfoMetaStore(ctx context.Context) api.MetaStore[*meta.TaskInfo]

func (*MySQLMetaStore) Txn

func (s *MySQLMetaStore) Txn(ctx context.Context) (any, func(err error) error, error)

type TaskCollectionPositionEtcdStore

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

func NewTaskCollectionPositionEtcdStore

func NewTaskCollectionPositionEtcdStore(ctx context.Context, etcdClient *clientv3.Client, rootPath string, txnMap map[any][]clientv3.Op) (*TaskCollectionPositionEtcdStore, error)

func (*TaskCollectionPositionEtcdStore) Delete

func (*TaskCollectionPositionEtcdStore) Get

func (*TaskCollectionPositionEtcdStore) Put

type TaskCollectionPositionMysqlStore

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

func NewTaskCollectionPositionMysqlStore

func NewTaskCollectionPositionMysqlStore(ctx context.Context, db *sql.DB, rootPath string, txnMap map[any]func() *sql.Tx) (*TaskCollectionPositionMysqlStore, error)

func (*TaskCollectionPositionMysqlStore) Delete

func (*TaskCollectionPositionMysqlStore) Get

func (*TaskCollectionPositionMysqlStore) Put

type TaskInfoEtcdStore

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

func NewTaskInfoEtcdStore

func NewTaskInfoEtcdStore(ctx context.Context, etcdClient *clientv3.Client, rootPath string, txnMap map[any][]clientv3.Op) (*TaskInfoEtcdStore, error)

func (*TaskInfoEtcdStore) Delete

func (t *TaskInfoEtcdStore) Delete(ctx context.Context, metaObj *meta.TaskInfo, txn any) error

func (*TaskInfoEtcdStore) Get

func (t *TaskInfoEtcdStore) Get(ctx context.Context, metaObj *meta.TaskInfo, txn any) ([]*meta.TaskInfo, error)

func (*TaskInfoEtcdStore) Put

func (t *TaskInfoEtcdStore) Put(ctx context.Context, metaObj *meta.TaskInfo, txn any) error

type TaskInfoMysqlStore

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

func NewTaskInfoMysqlStore

func NewTaskInfoMysqlStore(ctx context.Context, db *sql.DB, rootPath string, txnMap map[any]func() *sql.Tx) (*TaskInfoMysqlStore, error)

func (*TaskInfoMysqlStore) Delete

func (m *TaskInfoMysqlStore) Delete(ctx context.Context, metaObj *meta.TaskInfo, txn any) error

func (*TaskInfoMysqlStore) Get

func (m *TaskInfoMysqlStore) Get(ctx context.Context, metaObj *meta.TaskInfo, txn any) ([]*meta.TaskInfo, error)

func (*TaskInfoMysqlStore) Put

func (m *TaskInfoMysqlStore) Put(ctx context.Context, metaObj *meta.TaskInfo, txn any) error

Jump to

Keyboard shortcuts

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