Documentation ¶
Index ¶
- Constants
- type TaskNode
- func (taskNode *TaskNode) AsyncReplicateObject(req *types.ReplicateObjectRequest, notifyErrCh chan error) (err error)
- func (taskNode *TaskNode) EncodeReplicateSegments(ctx context.Context, objectID uint64, segments uint32, replicates int, ...) (data [][][]byte, err error)
- func (taskNode *TaskNode) Name() string
- func (taskNode *TaskNode) QueryReplicatingObject(ctx context.Context, req *types.QueryReplicatingObjectRequest) (resp *types.QueryReplicatingObjectResponse, err error)
- func (taskNode *TaskNode) ReplicateObject(ctx context.Context, req *types.ReplicateObjectRequest) (resp *types.ReplicateObjectResponse, err error)
- func (taskNode *TaskNode) Start(ctx context.Context) error
- func (taskNode *TaskNode) Stop(ctx context.Context) error
- type TaskNodeConfig
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) AsyncReplicateObject ¶
func (taskNode *TaskNode) AsyncReplicateObject(req *types.ReplicateObjectRequest, notifyErrCh chan error) (err error)
AsyncReplicateObject replicate an object payload to other storage providers and seal object.
func (*TaskNode) EncodeReplicateSegments ¶
func (taskNode *TaskNode) EncodeReplicateSegments(ctx context.Context, objectID uint64, segments uint32, replicates int, rType storagetypes.RedundancyType) (data [][][]byte, err error)
EncodeReplicateSegments load segment data and encode according to redundancy type
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) ( resp *types.ReplicateObjectResponse, err error)
ReplicateObject call AsyncReplicateObject non-blocking upstream services
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
Click to show internal directories.
Click to hide internal directories.