pieceerror

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ErrHandlerChanSize = 100
	HandleErrorPool    = 4
	GCHandlingInterval = 1 * time.Second
	GCHandlingDelay    = 3 * time.Second
)

Variables

This section is empty.

Functions

func Register

func Register(errType string, initer handlerInitFunc)

Types

type FileMd5NotMatchHandler

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

func (*FileMd5NotMatchHandler) Handle

func (fnmh *FileMd5NotMatchHandler) Handle(ctx context.Context, pieceErrorRequest *types.PieceErrorRequest) error

type FileNotExistHandler

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

func (*FileNotExistHandler) Handle

func (feh *FileNotExistHandler) Handle(ctx context.Context, pieceErrorRequest *types.PieceErrorRequest) error

type Handler

type Handler interface {
	Handle(ctx context.Context, pieceErrorRequest *types.PieceErrorRequest) error
}

TODO: make it pluggable

func NewFileMd5NotMatchHandler

func NewFileMd5NotMatchHandler(gcManager mgr.GCMgr, cdnManager mgr.CDNMgr) (Handler, error)

func NewFileNotExistHandler

func NewFileNotExistHandler(gcManager mgr.GCMgr, cdnManager mgr.CDNMgr) (Handler, error)

type Manager

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

func NewManager

func NewManager(cfg *config.Config, gcManager mgr.GCMgr, cdnManager mgr.CDNMgr) (*Manager, error)

func (*Manager) HandlePieceError

func (em *Manager) HandlePieceError(ctx context.Context, pieceErrorRequest *types.PieceErrorRequest) error

HandlePieceError the peer should report the error with related info when it failed to download a piece from supernode. And the supernode should handle the piece Error and do some repair operations.

func (*Manager) StartHandleError

func (em *Manager) StartHandleError(ctx context.Context)

StartHandleError starts a goroutine to handle the piece error.

Jump to

Keyboard shortcuts

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