Documentation ¶
Index ¶
- Constants
- type DataConflictInfo
- type ErrorManager
- func (em *ErrorManager) HasError() bool
- func (em *ErrorManager) Init(ctx context.Context) error
- func (em *ErrorManager) LogErrorDetails()
- func (em *ErrorManager) Output() string
- func (em *ErrorManager) RecordDataConflictError(ctx context.Context, logger log.Logger, tableName string, ...) error
- func (em *ErrorManager) RecordIndexConflictError(ctx context.Context, logger log.Logger, tableName string, indexNames []string, ...) error
- func (em *ErrorManager) RecordTypeError(ctx context.Context, logger log.Logger, tableName string, path string, ...) error
- func (em *ErrorManager) ResolveAllConflictKeys(ctx context.Context, tableName string, pool *utils.WorkerPool, ...) error
- func (em *ErrorManager) TypeErrorsRemain() int64
Constants ¶
View Source
const (
// ConflictErrorTableName is the table name for duplicate detection.
ConflictErrorTableName = "conflict_error_v1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataConflictInfo ¶
type ErrorManager ¶
type ErrorManager struct {
// contains filtered or unexported fields
}
func (*ErrorManager) HasError ¶
func (em *ErrorManager) HasError() bool
func (*ErrorManager) Init ¶
func (em *ErrorManager) Init(ctx context.Context) error
Init creates the schemas and tables to store the task information.
func (*ErrorManager) LogErrorDetails ¶
func (em *ErrorManager) LogErrorDetails()
GenErrorLogFields return a slice of zap.Field for each error type
func (*ErrorManager) Output ¶
func (em *ErrorManager) Output() string
Output renders a table which contains error summery for each error type.
func (*ErrorManager) RecordDataConflictError ¶
func (em *ErrorManager) RecordDataConflictError( ctx context.Context, logger log.Logger, tableName string, conflictInfos []DataConflictInfo, ) error
func (*ErrorManager) RecordIndexConflictError ¶
func (em *ErrorManager) RecordIndexConflictError( ctx context.Context, logger log.Logger, tableName string, indexNames []string, conflictInfos []DataConflictInfo, rawHandles, rawRows [][]byte, ) error
func (*ErrorManager) RecordTypeError ¶
func (em *ErrorManager) RecordTypeError( ctx context.Context, logger log.Logger, tableName string, path string, offset int64, rowText string, encodeErr error, ) error
RecordTypeError records a type error. If the number of recorded type errors exceed the max-error count, also returns `err` directly.
func (*ErrorManager) ResolveAllConflictKeys ¶
func (em *ErrorManager) ResolveAllConflictKeys( ctx context.Context, tableName string, pool *utils.WorkerPool, fn func(ctx context.Context, handleRows [][2][]byte) error, ) error
ResolveAllConflictKeys query all conflicting rows (handle and their values) from the current error report and resolve them concurrently.
func (*ErrorManager) TypeErrorsRemain ¶
func (em *ErrorManager) TypeErrorsRemain() int64
Click to show internal directories.
Click to hide internal directories.