tasknode

package
v0.1.2-fix-3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: GPL-3.0 Imports: 35 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
)

Variables

This section is empty.

Functions

This section is empty.

Types

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