callback

package
v1.1.0-beta.0...-c7f1b95 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestDDLCallback

type TestDDLCallback struct {
	*ddl.BaseCallback
	// We recommended to pass the domain parameter to the test ddl callback, it will ensure
	// domain to reload schema before your ddl stepping into the next state change.
	Do ddl.DomainReloader

	OnJobRunBeforeExported func(*model.Job)
	OnJobRunAfterExported  func(*model.Job)

	OnJobUpdatedExported atomic.Pointer[func(*model.Job)]

	OnGetJobBeforeExported  func(string)
	OnGetJobAfterExported   func(string, *model.Job)
	OnJobSchemaStateChanged func(int64)

	OnUpdateReorgInfoExported func(job *model.Job, pid int64)
	// contains filtered or unexported fields
}

TestDDLCallback is used to customize user callback themselves.

func (*TestDDLCallback) Clone

func (tc *TestDDLCallback) Clone() *TestDDLCallback

Clone copies the callback and take its reference

func (*TestDDLCallback) OnChanged

func (tc *TestDDLCallback) OnChanged(err error) error

OnChanged mock the same behavior with the main DDL hook.

func (*TestDDLCallback) OnGetJobAfter

func (tc *TestDDLCallback) OnGetJobAfter(jobType string, job *model.Job)

OnGetJobAfter implements Callback.OnGetJobAfter interface.

func (*TestDDLCallback) OnGetJobBefore

func (tc *TestDDLCallback) OnGetJobBefore(jobType string)

OnGetJobBefore implements Callback.OnGetJobBefore interface.

func (*TestDDLCallback) OnJobRunAfter

func (tc *TestDDLCallback) OnJobRunAfter(job *model.Job)

OnJobRunAfter is used to run the user customized logic of `OnJobRunAfter` first.

func (*TestDDLCallback) OnJobRunBefore

func (tc *TestDDLCallback) OnJobRunBefore(job *model.Job)

OnJobRunBefore is used to run the user customized logic of `onJobRunBefore` first.

func (*TestDDLCallback) OnJobUpdated

func (tc *TestDDLCallback) OnJobUpdated(job *model.Job)

OnJobUpdated is used to run the user customized logic of `OnJobUpdated` first.

func (*TestDDLCallback) OnSchemaStateChanged

func (tc *TestDDLCallback) OnSchemaStateChanged(schemaVer int64)

OnSchemaStateChanged mock the same behavior with the main ddl hook.

func (*TestDDLCallback) OnUpdateReorgInfo

func (tc *TestDDLCallback) OnUpdateReorgInfo(job *model.Job, pid int64)

OnUpdateReorgInfo mock the same behavior with the main DDL reorg hook.

func (*TestDDLCallback) OnWatched

func (tc *TestDDLCallback) OnWatched(ctx context.Context)

OnWatched is used to run the user customized logic of `OnWatched` first.

type TestInterceptor

type TestInterceptor struct {
	*ddl.BaseInterceptor

	OnGetInfoSchemaExported func(ctx sessionctx.Context, is infoschema.InfoSchema) infoschema.InfoSchema
}

TestInterceptor is a test interceptor in the ddl

func (*TestInterceptor) OnGetInfoSchema

OnGetInfoSchema is to run when to call GetInfoSchema

Jump to

Keyboard shortcuts

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