tasknode

package
v0.1.3-test-1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: GPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReplicateFactor defines the redundancy of replication
	// TODO:: will update to (1, 2] on main net
	ReplicateFactor = 1
	// GetApprovalTimeout defines the timeout of getting secondary sp approval
	GetApprovalTimeout = 10
	// MaxSealRetryNumber defines max number of retrying seal object
	MaxSealRetryNumber = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PieceDataReader added in v0.2.0

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

PieceDataReader defines [][]pieceData Reader.

func (*PieceDataReader) Read added in v0.2.0

func (p *PieceDataReader) Read(buf []byte) (n int, err error)

Read populates the given byte slice with data and returns the number of bytes populated and an error value. It returns an io.EOF error when the stream ends.

type TaskNode

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

TaskNode as background min execution unit, execute storage provider's background tasks implements the gRPC of TaskNodeService, TODO :: TaskNode support more task types, such as gc etc.

func NewTaskNodeService

func NewTaskNodeService(cfg *TaskNodeConfig) (*TaskNode, error)

NewTaskNodeService return an instance of TaskNode and init resource

func (*TaskNode) Name

func (taskNode *TaskNode) Name() string

Name return the task node service name, for the lifecycle management

func (*TaskNode) QueryReplicatingObject

func (taskNode *TaskNode) QueryReplicatingObject(ctx context.Context, req *types.QueryReplicatingObjectRequest) (
	resp *types.QueryReplicatingObjectResponse, err error)

QueryReplicatingObject query a replicating object information by object id

func (*TaskNode) ReplicateObject

func (taskNode *TaskNode) ReplicateObject(ctx context.Context, req *types.ReplicateObjectRequest) (
	*types.ReplicateObjectResponse, error)

ReplicateObject call AsyncReplicateObject non-blocking upstream services

func (*TaskNode) Start

func (taskNode *TaskNode) Start(ctx context.Context) error

Start the task node gRPC service and background tasks

func (*TaskNode) Stop

func (taskNode *TaskNode) Stop(ctx context.Context) error

Stop the task node gRPC service and recycle the resources

type TaskNodeConfig

type TaskNodeConfig struct {
	SpOperatorAddress string
	GRPCAddress       string
	SignerGrpcAddress string
	P2PGrpcAddress    string
	SpDBConfig        *config.SQLDBConfig
	PieceStoreConfig  *storage.PieceStoreConfig
	ChainConfig       *greenfield.GreenfieldChainConfig
}

TaskNodeConfig defines TaskNode service config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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