Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultManagerOptions(manager *ManageModular, cfg *gfspconfig.GfSpConfig) error
- func NewManageModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
- type ManageModular
- func (m *ManageModular) DispatchTask(ctx context.Context, limit rcmgr.Limit) (task.Task, error)
- func (m *ManageModular) FilterGCTask(qTask task.Task) bool
- func (m *ManageModular) FilterUploadingTask(qTask task.Task) bool
- func (m *ManageModular) GCCacheQueue(qTask task.Task) bool
- func (m *ManageModular) GCReceiveQueue(qTask task.Task) bool
- func (m *ManageModular) GCReplicatePieceQueue(qTask task.Task) bool
- func (m *ManageModular) GCSealObjectQueue(qTask task.Task) bool
- func (m *ManageModular) GCUploadObjectQueue(qTask task.Task) bool
- func (m *ManageModular) HandleChallengePieceTask(ctx context.Context, task task.ChallengePieceTask) error
- func (m *ManageModular) HandleCreateUploadObjectTask(ctx context.Context, task task.UploadObjectTask) error
- func (m *ManageModular) HandleDoneUploadObjectTask(ctx context.Context, task task.UploadObjectTask) error
- func (m *ManageModular) HandleDownloadObjectTask(ctx context.Context, task task.DownloadObjectTask) error
- func (m *ManageModular) HandleGCMetaTask(ctx context.Context, task task.GCMetaTask) error
- func (m *ManageModular) HandleGCObjectTask(ctx context.Context, gcTask task.GCObjectTask) error
- func (m *ManageModular) HandleGCZombiePieceTask(ctx context.Context, task task.GCZombiePieceTask) error
- func (m *ManageModular) HandleReceivePieceTask(ctx context.Context, task task.ReceivePieceTask) error
- func (m *ManageModular) HandleReplicatePieceTask(ctx context.Context, task task.ReplicatePieceTask) error
- func (m *ManageModular) HandleSealObjectTask(ctx context.Context, task task.SealObjectTask) error
- func (m *ManageModular) LoadTaskFromDB() error
- func (m *ManageModular) Name() string
- func (m *ManageModular) PickUpTask(ctx context.Context, tasks []task.Task) task.Task
- func (m *ManageModular) QueryTasks(ctx context.Context, subKey task.TKey) ([]task.Task, error)
- func (m *ManageModular) ReleaseResource(ctx context.Context, span rcmgr.ResourceScopeSpan)
- func (m *ManageModular) ReserveResource(ctx context.Context, state *rcmgr.ScopeStat) (rcmgr.ResourceScopeSpan, error)
- func (m *ManageModular) ResetGCObjectTask(qTask task.Task) bool
- func (m *ManageModular) Start(ctx context.Context) error
- func (m *ManageModular) Statistics() string
- func (m *ManageModular) Stop(ctx context.Context) error
- func (m *ManageModular) TaskUploading(ctx context.Context, task task.Task) bool
- func (m *ManageModular) UploadingObjectNumber() int
Constants ¶
View Source
const ( // DefaultGlobalMaxUploadingNumber defines the default max uploading object number // in SP, include: uploading object to primary, replicate object to secondaries, // and sealing object on greenfield. DefaultGlobalMaxUploadingNumber int = 4096 // DefaultGlobalUploadObjectParallel defines the default max parallel uploading // objects to primary in SP system. DefaultGlobalUploadObjectParallel int = 1024 // DefaultGlobalReplicatePieceParallel defines the default max parallel replicating // objects to primary in SP system. DefaultGlobalReplicatePieceParallel int = 1024 // DefaultGlobalSealObjectParallel defines the default max parallel sealing objects // on greenfield in SP system. DefaultGlobalSealObjectParallel int = 1024 // DefaultGlobalReceiveObjectParallel defines the default max parallel confirming // receive pieces on greenfield in SP system. DefaultGlobalReceiveObjectParallel int = 4096 // DefaultGlobalGCObjectParallel defines the default max parallel gc objects in SP // system. DefaultGlobalGCObjectParallel int = 4 // DefaultGlobalGCZombieParallel defines the default max parallel gc zonbie pieces // in SP system. DefaultGlobalGCZombieParallel int = 1 // DefaultGlobalGCMetaParallel defines the default max parallel gc meta db in SP // system. DefaultGlobalGCMetaParallel int = 1 // DefaultGlobalDownloadObjectTaskCacheSize defines the default max cache the download // object tasks in manager. DefaultGlobalDownloadObjectTaskCacheSize int = 4096 // DefaultGlobalChallengePieceTaskCacheSize defines the default max cache the challenge // piece tasks in manager. DefaultGlobalChallengePieceTaskCacheSize int = 4096 // DefaultGlobalBatchGcObjectTimeInterval defines the default interval for generating // gc object task. DefaultGlobalBatchGcObjectTimeInterval int = 30 * 60 // DefaultGlobalGcObjectBlockInterval defines the default blocks number for getting // deleted objects. DefaultGlobalGcObjectBlockInterval uint64 = 500 // DefaultGlobalGcObjectSafeBlockDistance defines the default distance form current block // height to gc the deleted object. DefaultGlobalGcObjectSafeBlockDistance uint64 = 1000 // DefaultGlobalSyncConsensusInfoInterval defines the default interval for sync the sp // info list to sp db. DefaultGlobalSyncConsensusInfoInterval uint64 = 2 // DefaultStatisticsOutputInterval defines the default interval for output statistics info, // it is used to log and debug. DefaultStatisticsOutputInterval int = 60 )
Variables ¶
View Source
var ( ErrDanglingTask = gfsperrors.Register(module.ManageModularName, http.StatusInternalServerError, 60001, "OoooH... request lost") ErrRepeatedTask = gfsperrors.Register(module.ManageModularName, http.StatusBadRequest, 60002, "request repeated") ErrExceedTask = gfsperrors.Register(module.ManageModularName, http.StatusServiceUnavailable, 60003, "OoooH... request exceed, try again later") ErrCanceledTask = gfsperrors.Register(module.ManageModularName, http.StatusBadRequest, 60004, "task canceled") ErrFutureSupport = gfsperrors.Register(module.ManageModularName, http.StatusNotFound, 60005, "future support") )
Functions ¶
func DefaultManagerOptions ¶
func DefaultManagerOptions(manager *ManageModular, cfg *gfspconfig.GfSpConfig) error
func NewManageModular ¶
func NewManageModular(app *gfspapp.GfSpBaseApp, cfg *gfspconfig.GfSpConfig) (coremodule.Modular, error)
Types ¶
type ManageModular ¶
type ManageModular struct {
// contains filtered or unexported fields
}
func (*ManageModular) DispatchTask ¶
func (*ManageModular) FilterGCTask ¶
func (m *ManageModular) FilterGCTask(qTask task.Task) bool
func (*ManageModular) FilterUploadingTask ¶
func (m *ManageModular) FilterUploadingTask(qTask task.Task) bool
func (*ManageModular) GCCacheQueue ¶
func (m *ManageModular) GCCacheQueue(qTask task.Task) bool
func (*ManageModular) GCReceiveQueue ¶
func (m *ManageModular) GCReceiveQueue(qTask task.Task) bool
func (*ManageModular) GCReplicatePieceQueue ¶
func (m *ManageModular) GCReplicatePieceQueue(qTask task.Task) bool
func (*ManageModular) GCSealObjectQueue ¶
func (m *ManageModular) GCSealObjectQueue(qTask task.Task) bool
func (*ManageModular) GCUploadObjectQueue ¶
func (m *ManageModular) GCUploadObjectQueue(qTask task.Task) bool
func (*ManageModular) HandleChallengePieceTask ¶
func (m *ManageModular) HandleChallengePieceTask( ctx context.Context, task task.ChallengePieceTask) error
func (*ManageModular) HandleCreateUploadObjectTask ¶
func (m *ManageModular) HandleCreateUploadObjectTask( ctx context.Context, task task.UploadObjectTask) error
func (*ManageModular) HandleDoneUploadObjectTask ¶
func (m *ManageModular) HandleDoneUploadObjectTask( ctx context.Context, task task.UploadObjectTask) error
func (*ManageModular) HandleDownloadObjectTask ¶
func (m *ManageModular) HandleDownloadObjectTask( ctx context.Context, task task.DownloadObjectTask) error
func (*ManageModular) HandleGCMetaTask ¶
func (m *ManageModular) HandleGCMetaTask( ctx context.Context, task task.GCMetaTask) error
func (*ManageModular) HandleGCObjectTask ¶
func (m *ManageModular) HandleGCObjectTask( ctx context.Context, gcTask task.GCObjectTask) error
func (*ManageModular) HandleGCZombiePieceTask ¶
func (m *ManageModular) HandleGCZombiePieceTask( ctx context.Context, task task.GCZombiePieceTask) error
func (*ManageModular) HandleReceivePieceTask ¶
func (m *ManageModular) HandleReceivePieceTask( ctx context.Context, task task.ReceivePieceTask) error
func (*ManageModular) HandleReplicatePieceTask ¶
func (m *ManageModular) HandleReplicatePieceTask( ctx context.Context, task task.ReplicatePieceTask) error
func (*ManageModular) HandleSealObjectTask ¶
func (m *ManageModular) HandleSealObjectTask( ctx context.Context, task task.SealObjectTask) error
func (*ManageModular) LoadTaskFromDB ¶
func (m *ManageModular) LoadTaskFromDB() error
func (*ManageModular) Name ¶
func (m *ManageModular) Name() string
func (*ManageModular) PickUpTask ¶
func (*ManageModular) QueryTasks ¶
func (*ManageModular) ReleaseResource ¶
func (m *ManageModular) ReleaseResource(ctx context.Context, span rcmgr.ResourceScopeSpan)
func (*ManageModular) ReserveResource ¶
func (m *ManageModular) ReserveResource(ctx context.Context, state *rcmgr.ScopeStat) (rcmgr.ResourceScopeSpan, error)
func (*ManageModular) ResetGCObjectTask ¶
func (m *ManageModular) ResetGCObjectTask(qTask task.Task) bool
func (*ManageModular) Statistics ¶
func (m *ManageModular) Statistics() string
func (*ManageModular) TaskUploading ¶
func (*ManageModular) UploadingObjectNumber ¶
func (m *ManageModular) UploadingObjectNumber() int
Click to show internal directories.
Click to hide internal directories.