Documentation
¶
Index ¶
- Variables
- type EdgeUpdateManager
- func (eu *EdgeUpdateManager) DeleteEdgeUpdateConfig(ctx context.Context, nodeType int) error
- func (eu *EdgeUpdateManager) GetEdgeUpdateConfigs(ctx context.Context) (map[int]*api.EdgeUpdateConfig, error)
- func (eu *EdgeUpdateManager) SetEdgeUpdateConfig(ctx context.Context, info *api.EdgeUpdateConfig) error
- type Scheduler
- func (s *Scheduler) AddAWSData(ctx context.Context, list []types.AWSDataInfo) error
- func (s *Scheduler) AddNodeServiceEvent(ctx context.Context, event *types.ServiceEvent) error
- func (s *Scheduler) AssignTunserverURL(ctx context.Context) (*types.TunserverRsp, error)
- func (s *Scheduler) CalculateDowntimePenalty(ctx context.Context, nodeID string) (types.ExitProfitRsp, error)
- func (s *Scheduler) CalculateExitProfit(ctx context.Context, nodeID string) (types.ExitProfitRsp, error)
- func (s *Scheduler) CandidateCodeExist(ctx context.Context, code string) (bool, error)
- func (s *Scheduler) CandidateConnect(ctx context.Context, opts *types.ConnectOptions) error
- func (s *Scheduler) CheckIpUsage(ctx context.Context, ip string) (bool, error)
- func (s *Scheduler) CleanupNode(ctx context.Context, nodeID, key string) error
- func (s *Scheduler) CreateAsset(ctx context.Context, req *types.CreateAssetReq) (*types.UploadInfo, error)
- func (s *Scheduler) CreateSyncAsset(ctx context.Context, req *types.CreateSyncAssetReq) error
- func (s *Scheduler) CreateTunnel(ctx context.Context, req *types.CreateTunnelReq) error
- func (s *Scheduler) DeactivateNode(ctx context.Context, nodeID string, hours int) error
- func (s *Scheduler) DeleteProject(ctx context.Context, req *types.ProjectReq) error
- func (s *Scheduler) DeployProject(ctx context.Context, req *types.DeployProjectReq) error
- func (s *Scheduler) DownloadDataResult(ctx context.Context, bucket, cid string, size int64) error
- func (s *Scheduler) EdgeConnect(ctx context.Context, opts *types.ConnectOptions) error
- func (s *Scheduler) ForceNodeOffline(ctx context.Context, nodeID string, forceOffline bool) error
- func (s *Scheduler) FreeUpDiskSpace(ctx context.Context, nodeID string, size int64) (*types.FreeUpDiskResp, error)
- func (s *Scheduler) GenerateCandidateCodes(ctx context.Context, count int, nodeType types.NodeType, isTest bool) ([]string, error)
- func (s *Scheduler) GenerateTokenForDownloadSource(ctx context.Context, nodeID string, cid string) (*types.SourceDownloadInfo, error)
- func (s *Scheduler) GenerateTokenForDownloadSources(ctx context.Context, cid string) ([]*types.SourceDownloadInfo, error)
- func (s *Scheduler) GetActiveAssetRecords(ctx context.Context, offset int, limit int) (*types.ListAssetRecordRsp, error)
- func (s *Scheduler) GetAssetCount(ctx context.Context) (int, error)
- func (s *Scheduler) GetAssetDownloadResults(ctx context.Context, hash string, start, end time.Time) (*types.ListAssetDownloadRsp, error)
- func (s *Scheduler) GetAssetListForBucket(ctx context.Context, bucketID uint32) ([]string, error)
- func (s *Scheduler) GetAssetRecord(ctx context.Context, cid string) (*types.AssetRecord, error)
- func (s *Scheduler) GetAssetRecords(ctx context.Context, limit, offset int, statuses []string, ...) ([]*types.AssetRecord, error)
- func (s *Scheduler) GetAssetRecordsByDateRange(ctx context.Context, offset int, limit int, start, end time.Time) (*types.ListAssetRecordRsp, error)
- func (s *Scheduler) GetAssetRecordsWithCIDs(ctx context.Context, cids []string) ([]*types.AssetRecord, error)
- func (s *Scheduler) GetAssetSourceDownloadInfo(ctx context.Context, cid string) (*types.AssetSourceDownloadInfoRsp, error)
- func (s *Scheduler) GetAssetView(ctx context.Context, nodeID string, isFromNode bool) (*types.AssetView, error)
- func (s *Scheduler) GetAssetsForNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListNodeAssetRsp, error)
- func (s *Scheduler) GetAssetsInBucket(ctx context.Context, nodeID string, bucketID int, isFromNode bool) ([]string, error)
- func (s *Scheduler) GetCandidateCodeInfos(ctx context.Context, nodeID, code string) ([]*types.CandidateCodeInfo, error)
- func (s *Scheduler) GetCandidateDownloadInfos(ctx context.Context, cid string) ([]*types.CandidateDownloadInfo, error)
- func (s *Scheduler) GetCandidateIPs(ctx context.Context) ([]*types.NodeIPInfo, error)
- func (s *Scheduler) GetCandidateNodeIP(ctx context.Context, nodeID string) (string, error)
- func (s *Scheduler) GetCandidateURLsForDetectNat(ctx context.Context) ([]string, error)
- func (s *Scheduler) GetCurrentRegionInfos(ctx context.Context, areaID string) (map[string]int, error)
- func (s *Scheduler) GetDeploymentProviderIP(ctx context.Context, id types.DeploymentID) (string, error)
- func (s *Scheduler) GetDownloadResultsFromAssets(ctx context.Context, hashes []string, start, end time.Time) ([]*types.AssetDownloadResultRsp, error)
- func (s *Scheduler) GetEdgeDownloadInfos(ctx context.Context, cid string) (*types.EdgeDownloadInfoList, error)
- func (s *Scheduler) GetEdgeExternalServiceAddress(ctx context.Context, nodeID, candidateURL string) (string, error)
- func (s *Scheduler) GetExternalAddress(ctx context.Context) (string, error)
- func (s *Scheduler) GetFailedReplicaByCID(ctx context.Context, cid string, limit, offset int) (*types.ListAssetReplicaEventRsp, error)
- func (s *Scheduler) GetFailedReplicaByNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListAssetReplicaEventRsp, error)
- func (s *Scheduler) GetMinioConfigFromCandidate(ctx context.Context, nodeID string) (*types.MinioConfig, error)
- func (s *Scheduler) GetNextFreeTime(ctx context.Context, nodeID string) (int64, error)
- func (s *Scheduler) GetNodeAssetReplicasByHashes(ctx context.Context, nodeID string, hashes []string) ([]*types.ReplicaInfo, error)
- func (s *Scheduler) GetNodeInfo(ctx context.Context, nodeID string) (*types.NodeInfo, error)
- func (s *Scheduler) GetNodeList(ctx context.Context, offset int, limit int) (*types.ListNodesRsp, error)
- func (s *Scheduler) GetNodeOfIP(ctx context.Context, ip string) ([]string, error)
- func (s *Scheduler) GetNodeOnlineState(ctx context.Context) (bool, error)
- func (s *Scheduler) GetNodePublicKey(ctx context.Context, nodeID string) (string, error)
- func (s *Scheduler) GetNodeToken(ctx context.Context, nodeID string) (string, error)
- func (s *Scheduler) GetNodeUploadInfo(ctx context.Context, userID string, passNonce string, urlMode bool) (*types.UploadInfo, error)
- func (s *Scheduler) GetNodeUploadInfoV2(ctx context.Context, info *types.GetUploadInfoReq) (*types.UploadInfo, error)
- func (s *Scheduler) GetNodesFromRegion(ctx context.Context, areaID string) ([]*types.NodeInfo, error)
- func (s *Scheduler) GetOnlineNodeCount(ctx context.Context, nodeType types.NodeType) (int, error)
- func (s *Scheduler) GetProfitDetailsForNode(ctx context.Context, nodeID string, limit, offset int, ts []int) (*types.ListNodeProfitDetailsRsp, error)
- func (s *Scheduler) GetProjectInfo(ctx context.Context, uuid string) (*types.ProjectInfo, error)
- func (s *Scheduler) GetProjectInfos(ctx context.Context, userID string, limit, offset int) ([]*types.ProjectInfo, error)
- func (s *Scheduler) GetProjectOverviewByNode(ctx context.Context, req *types.NodeProjectReq) (*types.ListProjectOverviewRsp, error)
- func (s *Scheduler) GetProjectReplicasForNode(ctx context.Context, req *types.NodeProjectReq) (*types.ListProjectReplicaRsp, error)
- func (s *Scheduler) GetProjectsForNode(ctx context.Context, nodeID string) ([]*types.ProjectReplicas, error)
- func (s *Scheduler) GetReplicaEvents(ctx context.Context, start, end time.Time, limit, offset int) (*types.ListAssetReplicaEventRsp, error)
- func (s *Scheduler) GetReplicaEventsForNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListAssetReplicaEventRsp, error)
- func (s *Scheduler) GetReplicas(ctx context.Context, cid string, limit, offset int) (*types.ListReplicaRsp, error)
- func (s *Scheduler) GetReplicasForNode(ctx context.Context, nodeID string, limit, offset int, ...) (*types.ListNodeReplicaRsp, error)
- func (s *Scheduler) GetSchedulerPublicKey(ctx context.Context) (string, error)
- func (s *Scheduler) GetSucceededReplicaByCID(ctx context.Context, cid string, limit, offset int) (*types.ListReplicaRsp, error)
- func (s *Scheduler) GetSucceededReplicaByNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListReplicaRsp, error)
- func (s *Scheduler) GetTunserverURLFromUser(ctx context.Context, req *types.TunserverReq) (*types.TunserverRsp, error)
- func (s *Scheduler) GetValidationResults(ctx context.Context, nodeID string, limit, offset int) (*types.ListValidationResultRsp, error)
- func (s *Scheduler) GetValidators(ctx context.Context) ([]string, error)
- func (s *Scheduler) GetWorkloadRecord(ctx context.Context, id string) (*types.WorkloadRecord, error)
- func (s *Scheduler) GetWorkloadRecords(ctx context.Context, nodeID string, limit, offset int) (*types.ListWorkloadRecordRsp, error)
- func (s *Scheduler) L3Connect(ctx context.Context, opts *types.ConnectOptions) error
- func (s *Scheduler) L5Connect(ctx context.Context, opts *types.ConnectOptions) error
- func (s *Scheduler) LoadAWSData(ctx context.Context, limit, offset int, isDistribute bool) ([]*types.AWSDataInfo, error)
- func (s *Scheduler) LoadNodeBandwidthScores(ctx context.Context, nodeID string, start, end time.Time, limit int, ...) (*types.ListBandwidthScoreRsp, error)
- func (s *Scheduler) LoadServiceEvents(ctx context.Context, startTime, endTime time.Time) (map[string]*types.ServiceStats, error)
- func (s *Scheduler) MigrateNodeIn(ctx context.Context, info *types.NodeMigrateInfo) error
- func (s *Scheduler) MigrateNodeOut(ctx context.Context, nodeID string) (*types.NodeMigrateInfo, error)
- func (s *Scheduler) MinioUploadFileEvent(ctx context.Context, event *types.MinioUploadFileEvent) error
- func (s *Scheduler) NatPunch(ctx context.Context, target *types.NatPunchReq) error
- func (s *Scheduler) NodeExists(ctx context.Context, nodeID string) error
- func (s *Scheduler) NodeKeepalive(ctx context.Context) (*types.KeepaliveRsp, error)
- func (s *Scheduler) NodeKeepaliveV2(ctx context.Context) (uuid.UUID, error)
- func (s *Scheduler) NodeKeepaliveV3(ctx context.Context, req *types.KeepaliveReq) (*types.KeepaliveRsp, error)
- func (s *Scheduler) NodeLogin(ctx context.Context, nodeID, sign string) (string, error)
- func (s *Scheduler) NodeRemoveAssetResult(ctx context.Context, resultInfo types.RemoveAssetResult) error
- func (s *Scheduler) NodeValidationResult(ctx context.Context, r io.Reader, sign string) error
- func (s *Scheduler) PerformSyncData(ctx context.Context, nodeID string) error
- func (s *Scheduler) PullAsset(ctx context.Context, info *types.PullAssetReq) error
- func (s *Scheduler) ReDetermineNodeNATType(ctx context.Context, nodeID string) error
- func (s *Scheduler) RePullFailedAssets(ctx context.Context, hashes []types.AssetHash) error
- func (s *Scheduler) RecompenseNodeProfit(ctx context.Context, nodeID, note string, profit float64) error
- func (s *Scheduler) RedeployFailedProjects(ctx context.Context, ids []string) error
- func (s *Scheduler) RegisterCandidateNode(ctx context.Context, nodeID, publicKey, code string) (*types.ActivationDetail, error)
- func (s *Scheduler) RegisterEdgeNode(ctx context.Context, nodeID, publicKey string) (*types.ActivationDetail, error)
- func (s *Scheduler) RegisterNode(ctx context.Context, nodeID, publicKey string, nodeType types.NodeType) (*types.ActivationDetail, error)
- func (s *Scheduler) RegisterNodeV2(ctx context.Context, info types.NodeRegister) (*types.ActivationDetail, error)
- func (s *Scheduler) RemoveAssetRecord(ctx context.Context, cid string) error
- func (s *Scheduler) RemoveAssetRecords(ctx context.Context, cids []string) error
- func (s *Scheduler) RemoveAssetReplica(ctx context.Context, cid, nodeID string) error
- func (s *Scheduler) RemoveCandidateCode(ctx context.Context, code string) error
- func (s *Scheduler) RemoveNodeFailedReplica(ctx context.Context) error
- func (s *Scheduler) RequestActivationCodes(ctx context.Context, nodeType types.NodeType, count int) ([]*types.NodeActivation, error)
- func (s *Scheduler) ResetAssetReplicaCount(ctx context.Context, cid string, count int) error
- func (s *Scheduler) ResetCandidateCode(ctx context.Context, nodeID, code string) error
- func (s *Scheduler) SetTunserverURL(ctx context.Context, nodeID, wsNodeID string) error
- func (s *Scheduler) ShareAssetV2(ctx context.Context, info *types.ShareAssetReq) (*types.ShareAssetRsp, error)
- func (s *Scheduler) StartProject(ctx context.Context, req *types.ProjectReq) error
- func (s *Scheduler) StopAssetRecord(ctx context.Context, cids []string) error
- func (s *Scheduler) SubmitProjectReport(ctx context.Context, req *types.ProjectRecordReq) error
- func (s *Scheduler) SubmitWorkloadReport(ctx context.Context, workload *types.WorkloadRecordReq) error
- func (s *Scheduler) SubmitWorkloadReportV2(ctx context.Context, workload *types.WorkloadRecordReq) error
- func (s *Scheduler) SwitchFillDiskTimer(ctx context.Context, open bool) error
- func (s *Scheduler) UndoNodeDeactivation(ctx context.Context, nodeID string) error
- func (s *Scheduler) UpdateAssetExpiration(ctx context.Context, cid string, t time.Time) error
- func (s *Scheduler) UpdateBandwidths(ctx context.Context, bandwidthDown, bandwidthUp int64) error
- func (s *Scheduler) UpdateNodePort(ctx context.Context, nodeID, port string) error
- func (s *Scheduler) UpdateProject(ctx context.Context, req *types.ProjectReq) error
- func (s *Scheduler) UpdateProjectStatus(ctx context.Context, list []*types.Project) error
- func (s *Scheduler) UserAssetDownloadResult(ctx context.Context, userID, cid string, totalTraffic, peakBandwidth int64) error
- func (s *Scheduler) UserAssetDownloadResultV2(ctx context.Context, info *types.RetrieveEvent) error
- func (s *Scheduler) VerifyTokenWithLimitCount(ctx context.Context, token string) (*types.JWTPayload, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrOfflineNode = errors.New("node offline") ErrDeploymentNotFound = errors.New("deployment not found") ErrDomainAlreadyExist = errors.New("domain already exist") ErrPermissionNotAllowed = errors.New("permission not allowed") ErrInvalidDomain = errors.New("invalid domain") ErrInvalidAnnotations = errors.New("invalid annotations") )
Functions ¶
This section is empty.
Types ¶
type EdgeUpdateManager ¶
type EdgeUpdateManager struct {
// contains filtered or unexported fields
}
EdgeUpdateManager manages information about edge node updates.
func NewEdgeUpdateManager ¶
func NewEdgeUpdateManager(db *db.SQLDB) (*EdgeUpdateManager, error)
NewEdgeUpdateManager creates a new EdgeUpdateManager with the given SQL database connection.
func (*EdgeUpdateManager) DeleteEdgeUpdateConfig ¶
func (eu *EdgeUpdateManager) DeleteEdgeUpdateConfig(ctx context.Context, nodeType int) error
DeleteEdgeUpdateConfig deletes the EdgeUpdateConfig for the given node type.
func (*EdgeUpdateManager) GetEdgeUpdateConfigs ¶
func (eu *EdgeUpdateManager) GetEdgeUpdateConfigs(ctx context.Context) (map[int]*api.EdgeUpdateConfig, error)
GetEdgeUpdateConfigs returns the map of edge node update information.
func (*EdgeUpdateManager) SetEdgeUpdateConfig ¶
func (eu *EdgeUpdateManager) SetEdgeUpdateConfig(ctx context.Context, info *api.EdgeUpdateConfig) error
SetEdgeUpdateConfig sets the EdgeUpdateConfig for the given node type.
type Scheduler ¶
type Scheduler struct { fx.In region.Region *common.CommonAPI *EdgeUpdateManager dtypes.ServerID NodeManager *node.Manager ValidationMgr *validation.Manager AssetManager *assets.Manager NatManager *nat.Manager DataSync *sSync.DataSync SchedulerCfg *config.SchedulerCfg SetSchedulerConfigFunc dtypes.SetSchedulerConfigFunc GetSchedulerConfigFunc dtypes.GetSchedulerConfigFunc WorkloadManager *workload.Manager ProjectManager *projects.Manager PrivateKey *rsa.PrivateKey Transport *quic.Transport }
Scheduler represents a scheduler node in a distributed system.
func (*Scheduler) AddAWSData ¶ added in v0.1.13
AddAWSData saves the provided AWS data information to the database.
func (*Scheduler) AddNodeServiceEvent ¶ added in v0.1.22
func (*Scheduler) AssignTunserverURL ¶ added in v0.1.19
AssignTunserverURL assigns a Tunserver URL.
func (*Scheduler) CalculateDowntimePenalty ¶ added in v0.1.22
func (s *Scheduler) CalculateDowntimePenalty(ctx context.Context, nodeID string) (types.ExitProfitRsp, error)
CalculateDowntimePenalty calculates the penalty points to be deducted for a node's requested downtime.
func (*Scheduler) CalculateExitProfit ¶ added in v0.1.19
func (s *Scheduler) CalculateExitProfit(ctx context.Context, nodeID string) (types.ExitProfitRsp, error)
CalculateExitProfit Deprecated
func (*Scheduler) CandidateCodeExist ¶ added in v0.1.19
CandidateCodeExist checks if a candidate code exists in the database.
func (*Scheduler) CandidateConnect ¶
CandidateConnect candidate node login to the scheduler
func (*Scheduler) CheckIpUsage ¶ added in v0.1.14
CheckIpUsage checks if a specific IP address is present on the server.
func (*Scheduler) CleanupNode ¶ added in v0.1.22
CleanupNode removes residual data from the source server after a node has been migrated.
func (*Scheduler) CreateAsset ¶ added in v0.1.10
func (s *Scheduler) CreateAsset(ctx context.Context, req *types.CreateAssetReq) (*types.UploadInfo, error)
CreateAsset creates an asset with car CID, car name, and car size.
func (*Scheduler) CreateSyncAsset ¶ added in v0.1.21
CreateSyncAsset Synchronizing assets from other schedulers
func (*Scheduler) CreateTunnel ¶ added in v0.1.21
CreateTunnel create tunnel for workerd communication
func (*Scheduler) DeactivateNode ¶ added in v0.1.11
DeactivateNode is used to deactivate a node in the titan server. It stops the node from serving any requests and marks it as inactive. - nodeID: The ID of the node to deactivate. - hours: The deactivation countdown time in hours. It specifies the duration before the deactivation is executed. If the deactivation is canceled within this period, the node will remain active.
func (*Scheduler) DeleteProject ¶ added in v0.1.19
DeleteProject removes a project based on the provided request.
func (*Scheduler) DeployProject ¶ added in v0.1.19
DeployProject deploys a project based on the provided request.
func (*Scheduler) DownloadDataResult ¶ added in v0.1.13
DownloadDataResult node download data result
func (*Scheduler) EdgeConnect ¶
EdgeConnect edge node login to the scheduler
func (*Scheduler) ForceNodeOffline ¶ added in v0.1.22
ForceNodeOffline changes the online status of a node identified by nodeID. If the status is true, it forces the node offline. If the status is false, it brings the node back online.
func (*Scheduler) FreeUpDiskSpace ¶ added in v0.1.19
func (s *Scheduler) FreeUpDiskSpace(ctx context.Context, nodeID string, size int64) (*types.FreeUpDiskResp, error)
FreeUpDiskSpace Request to free up disk space, returns file hashes and next time
func (*Scheduler) GenerateCandidateCodes ¶ added in v0.1.21
func (s *Scheduler) GenerateCandidateCodes(ctx context.Context, count int, nodeType types.NodeType, isTest bool) ([]string, error)
GenerateCandidateCodes generates a specified number of candidate codes for a given node type.
func (*Scheduler) GenerateTokenForDownloadSource ¶ added in v0.1.21
func (s *Scheduler) GenerateTokenForDownloadSource(ctx context.Context, nodeID string, cid string) (*types.SourceDownloadInfo, error)
GenerateTokenForDownloadSource Generate Token For Download Source
func (*Scheduler) GenerateTokenForDownloadSources ¶ added in v0.1.22
func (s *Scheduler) GenerateTokenForDownloadSources(ctx context.Context, cid string) ([]*types.SourceDownloadInfo, error)
GenerateTokenForDownloadSources Generate Token For Download Source
func (*Scheduler) GetActiveAssetRecords ¶ added in v0.1.22
func (s *Scheduler) GetActiveAssetRecords(ctx context.Context, offset int, limit int) (*types.ListAssetRecordRsp, error)
GetActiveAssetRecords retrieves a list of asset records.
func (*Scheduler) GetAssetCount ¶ added in v0.1.10
GetAssetCount retrieves a count of asset
func (*Scheduler) GetAssetDownloadResults ¶ added in v0.1.22
func (s *Scheduler) GetAssetDownloadResults(ctx context.Context, hash string, start, end time.Time) (*types.ListAssetDownloadRsp, error)
GetAssetDownloadResults Retrieves Asset Download Results
func (*Scheduler) GetAssetListForBucket ¶
GetAssetListForBucket retrieves a list of asset hashes for the specified node's bucket.
func (*Scheduler) GetAssetRecord ¶
GetAssetRecord retrieves an asset record by its CID.
func (*Scheduler) GetAssetRecords ¶
func (s *Scheduler) GetAssetRecords(ctx context.Context, limit, offset int, statuses []string, serverID dtypes.ServerID) ([]*types.AssetRecord, error)
GetAssetRecords lists asset records with optional filtering by status, limit, and offset.
func (*Scheduler) GetAssetRecordsByDateRange ¶ added in v0.1.22
func (s *Scheduler) GetAssetRecordsByDateRange(ctx context.Context, offset int, limit int, start, end time.Time) (*types.ListAssetRecordRsp, error)
GetAssetRecordsByDateRange retrieves a list of asset records.
func (*Scheduler) GetAssetRecordsWithCIDs ¶ added in v0.1.22
func (s *Scheduler) GetAssetRecordsWithCIDs(ctx context.Context, cids []string) ([]*types.AssetRecord, error)
GetAssetRecordsWithCIDs retrieves a list of asset records with cid
func (*Scheduler) GetAssetSourceDownloadInfo ¶ added in v0.1.18
func (s *Scheduler) GetAssetSourceDownloadInfo(ctx context.Context, cid string) (*types.AssetSourceDownloadInfoRsp, error)
GetAssetSourceDownloadInfo retrieves the download details for a specified asset.
func (*Scheduler) GetAssetView ¶ added in v0.1.14
func (s *Scheduler) GetAssetView(ctx context.Context, nodeID string, isFromNode bool) (*types.AssetView, error)
GetAssetView get the asset view of node
func (*Scheduler) GetAssetsForNode ¶ added in v0.1.10
func (s *Scheduler) GetAssetsForNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListNodeAssetRsp, error)
GetAssetsForNode retrieves a asset list of node
func (*Scheduler) GetAssetsInBucket ¶ added in v0.1.14
func (s *Scheduler) GetAssetsInBucket(ctx context.Context, nodeID string, bucketID int, isFromNode bool) ([]string, error)
GetAssetsInBucket get the assets of the bucket
func (*Scheduler) GetCandidateCodeInfos ¶ added in v0.1.19
func (s *Scheduler) GetCandidateCodeInfos(ctx context.Context, nodeID, code string) ([]*types.CandidateCodeInfo, error)
GetCandidateCodeInfos retrieves candidate code information for a given node ID and code.
func (*Scheduler) GetCandidateDownloadInfos ¶
func (s *Scheduler) GetCandidateDownloadInfos(ctx context.Context, cid string) ([]*types.CandidateDownloadInfo, error)
GetCandidateDownloadInfos finds candidate download info for the given CID.
func (*Scheduler) GetCandidateIPs ¶ added in v0.1.11
GetCandidateIPs returns a list of candidate node IP information.
func (*Scheduler) GetCandidateNodeIP ¶ added in v0.1.11
GetCandidateNodeIP get candidate ip for locator
func (*Scheduler) GetCandidateURLsForDetectNat ¶
GetCandidateURLsForDetectNat returns candidate URLs for NAT detection.
func (*Scheduler) GetCurrentRegionInfos ¶ added in v0.1.19
func (s *Scheduler) GetCurrentRegionInfos(ctx context.Context, areaID string) (map[string]int, error)
GetCurrentRegionInfos returns the current region information for the given area ID.
func (*Scheduler) GetDeploymentProviderIP ¶ added in v0.1.21
func (s *Scheduler) GetDeploymentProviderIP(ctx context.Context, id types.DeploymentID) (string, error)
GetDeploymentProviderIP retrieves the provider IP for a given deployment ID.
func (*Scheduler) GetDownloadResultsFromAssets ¶ added in v0.1.22
func (s *Scheduler) GetDownloadResultsFromAssets(ctx context.Context, hashes []string, start, end time.Time) ([]*types.AssetDownloadResultRsp, error)
GetDownloadResultsFromAssets Retrieves Asset Download Results
func (*Scheduler) GetEdgeDownloadInfos ¶
func (s *Scheduler) GetEdgeDownloadInfos(ctx context.Context, cid string) (*types.EdgeDownloadInfoList, error)
GetEdgeDownloadInfos finds edge download information for a given CID
func (*Scheduler) GetEdgeExternalServiceAddress ¶
func (s *Scheduler) GetEdgeExternalServiceAddress(ctx context.Context, nodeID, candidateURL string) (string, error)
GetEdgeExternalServiceAddress returns the external service address of an edge node
func (*Scheduler) GetExternalAddress ¶
GetExternalAddress retrieves the external address of the caller.
func (*Scheduler) GetFailedReplicaByCID ¶ added in v0.1.22
func (s *Scheduler) GetFailedReplicaByCID(ctx context.Context, cid string, limit, offset int) (*types.ListAssetReplicaEventRsp, error)
GetFailedReplicaByCID retrieves failed replicas by CID with a specified limit and offset.
func (*Scheduler) GetFailedReplicaByNode ¶ added in v0.1.22
func (s *Scheduler) GetFailedReplicaByNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListAssetReplicaEventRsp, error)
GetFailedReplicaByNode retrieves failed replica events for a specific node.
func (*Scheduler) GetMinioConfigFromCandidate ¶ added in v0.1.11
func (s *Scheduler) GetMinioConfigFromCandidate(ctx context.Context, nodeID string) (*types.MinioConfig, error)
GetMinioConfigFromCandidate retrieves the MinIO configuration for the specified candidate node.
func (*Scheduler) GetNextFreeTime ¶ added in v0.1.19
GetNextFreeTime returns the next available time slot for the given node.
func (*Scheduler) GetNodeAssetReplicasByHashes ¶ added in v0.1.22
func (s *Scheduler) GetNodeAssetReplicasByHashes(ctx context.Context, nodeID string, hashes []string) ([]*types.ReplicaInfo, error)
GetNodeAssetReplicasByHashes retrieves replica by CID and node.
func (*Scheduler) GetNodeInfo ¶
GetNodeInfo returns information about the specified node.
func (*Scheduler) GetNodeList ¶
func (s *Scheduler) GetNodeList(ctx context.Context, offset int, limit int) (*types.ListNodesRsp, error)
GetNodeList retrieves a list of nodes with pagination.
func (*Scheduler) GetNodeOfIP ¶ added in v0.1.15
GetNodeOfIP get nodes of ip
func (*Scheduler) GetNodeOnlineState ¶ added in v0.1.13
GetNodeOnlineState returns the online state of the node and any error encountered.
func (*Scheduler) GetNodePublicKey ¶ added in v0.1.11
GetNodePublicKey get node publicKey
func (*Scheduler) GetNodeToken ¶ added in v0.1.13
GetNodeToken retrieves the token for the specified node.
func (*Scheduler) GetNodeUploadInfo ¶ added in v0.1.19
func (s *Scheduler) GetNodeUploadInfo(ctx context.Context, userID string, passNonce string, urlMode bool) (*types.UploadInfo, error)
GetNodeUploadInfo retrieves upload information for a specific user.
func (*Scheduler) GetNodeUploadInfoV2 ¶ added in v0.1.22
func (s *Scheduler) GetNodeUploadInfoV2(ctx context.Context, info *types.GetUploadInfoReq) (*types.UploadInfo, error)
GetNodeUploadInfoV2 retrieves upload information for a specific user.
func (*Scheduler) GetNodesFromRegion ¶ added in v0.1.19
func (s *Scheduler) GetNodesFromRegion(ctx context.Context, areaID string) ([]*types.NodeInfo, error)
GetNodesFromRegion retrieves nodes from a specified region.
func (*Scheduler) GetOnlineNodeCount ¶
GetOnlineNodeCount returns the count of online nodes for a given node type
func (*Scheduler) GetProfitDetailsForNode ¶ added in v0.1.18
func (s *Scheduler) GetProfitDetailsForNode(ctx context.Context, nodeID string, limit, offset int, ts []int) (*types.ListNodeProfitDetailsRsp, error)
GetProfitDetailsForNode retrieves profit details for a specific node.
func (*Scheduler) GetProjectInfo ¶ added in v0.1.19
GetProjectInfo retrieves project information by UUID.
func (*Scheduler) GetProjectInfos ¶ added in v0.1.19
func (s *Scheduler) GetProjectInfos(ctx context.Context, userID string, limit, offset int) ([]*types.ProjectInfo, error)
GetProjectInfos retrieves project information for a user with specified limits.
func (*Scheduler) GetProjectOverviewByNode ¶ added in v0.1.22
func (s *Scheduler) GetProjectOverviewByNode(ctx context.Context, req *types.NodeProjectReq) (*types.ListProjectOverviewRsp, error)
GetProjectOverviewByNode retrieves the project overview for a specific node.
func (*Scheduler) GetProjectReplicasForNode ¶ added in v0.1.22
func (s *Scheduler) GetProjectReplicasForNode(ctx context.Context, req *types.NodeProjectReq) (*types.ListProjectReplicaRsp, error)
GetProjectReplicasForNode retrieves project replicas for a given node based on the provided criteria.
func (*Scheduler) GetProjectsForNode ¶ added in v0.1.19
func (s *Scheduler) GetProjectsForNode(ctx context.Context, nodeID string) ([]*types.ProjectReplicas, error)
GetProjectsForNode retrieves the project replicas for the given node ID.
func (*Scheduler) GetReplicaEvents ¶ added in v0.1.11
func (s *Scheduler) GetReplicaEvents(ctx context.Context, start, end time.Time, limit, offset int) (*types.ListAssetReplicaEventRsp, error)
GetReplicaEvents retrieves replica events within a specified time range.
func (*Scheduler) GetReplicaEventsForNode ¶ added in v0.1.10
func (s *Scheduler) GetReplicaEventsForNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListAssetReplicaEventRsp, error)
GetReplicaEventsForNode retrieves a replica event list of node
func (*Scheduler) GetReplicas ¶ added in v0.1.11
func (s *Scheduler) GetReplicas(ctx context.Context, cid string, limit, offset int) (*types.ListReplicaRsp, error)
GetReplicas list asset replicas by CID.
func (*Scheduler) GetReplicasForNode ¶ added in v0.1.16
func (s *Scheduler) GetReplicasForNode(ctx context.Context, nodeID string, limit, offset int, statuses []types.ReplicaStatus) (*types.ListNodeReplicaRsp, error)
GetReplicasForNode retrieves a asset list of node
func (*Scheduler) GetSchedulerPublicKey ¶
GetSchedulerPublicKey get server publicKey
func (*Scheduler) GetSucceededReplicaByCID ¶ added in v0.1.22
func (s *Scheduler) GetSucceededReplicaByCID(ctx context.Context, cid string, limit, offset int) (*types.ListReplicaRsp, error)
GetSucceededReplicaByCID retrieves succeeded replicas by CID with a specified limit and offset.
func (*Scheduler) GetSucceededReplicaByNode ¶ added in v0.1.22
func (s *Scheduler) GetSucceededReplicaByNode(ctx context.Context, nodeID string, limit, offset int) (*types.ListReplicaRsp, error)
GetSucceededReplicaByNode retrieves succeeded replicas by node ID with a specified limit and offset.
func (*Scheduler) GetTunserverURLFromUser ¶ added in v0.1.21
func (s *Scheduler) GetTunserverURLFromUser(ctx context.Context, req *types.TunserverReq) (*types.TunserverRsp, error)
GetTunserverURLFromUser retrieves the Tunnel server URL based on the provided AreaID.
func (*Scheduler) GetValidationResults ¶
func (s *Scheduler) GetValidationResults(ctx context.Context, nodeID string, limit, offset int) (*types.ListValidationResultRsp, error)
GetValidationResults retrieves a list of validation results.
func (*Scheduler) GetValidators ¶ added in v0.1.22
GetValidators returns a list of validator addresses.
func (*Scheduler) GetWorkloadRecord ¶ added in v0.1.10
func (s *Scheduler) GetWorkloadRecord(ctx context.Context, id string) (*types.WorkloadRecord, error)
GetWorkloadRecord retrieves a list of workload results.
func (*Scheduler) GetWorkloadRecords ¶ added in v0.1.10
func (s *Scheduler) GetWorkloadRecords(ctx context.Context, nodeID string, limit, offset int) (*types.ListWorkloadRecordRsp, error)
GetWorkloadRecords retrieves a list of workload results.
func (*Scheduler) LoadAWSData ¶ added in v0.1.14
func (s *Scheduler) LoadAWSData(ctx context.Context, limit, offset int, isDistribute bool) ([]*types.AWSDataInfo, error)
LoadAWSData retrieves AWS data from the database with pagination and distribution options.
func (*Scheduler) LoadNodeBandwidthScores ¶ added in v0.1.22
func (*Scheduler) LoadServiceEvents ¶ added in v0.1.22
func (*Scheduler) MigrateNodeIn ¶ added in v0.1.22
MigrateNodeIn Migrate in the node
func (*Scheduler) MigrateNodeOut ¶ added in v0.1.22
func (s *Scheduler) MigrateNodeOut(ctx context.Context, nodeID string) (*types.NodeMigrateInfo, error)
MigrateNodeOut Migrate out the node
func (*Scheduler) MinioUploadFileEvent ¶ added in v0.1.11
func (s *Scheduler) MinioUploadFileEvent(ctx context.Context, event *types.MinioUploadFileEvent) error
MinioUploadFileEvent handles the Minio file upload event.
func (*Scheduler) NodeExists ¶
NodeExists checks if the node with the specified ID exists.
func (*Scheduler) NodeKeepalive ¶
NodeKeepalive candidate and edge keepalive
func (*Scheduler) NodeKeepaliveV2 ¶ added in v0.1.11
NodeKeepaliveV2 candidate and edge keepalive
func (*Scheduler) NodeKeepaliveV3 ¶ added in v0.1.22
func (s *Scheduler) NodeKeepaliveV3(ctx context.Context, req *types.KeepaliveReq) (*types.KeepaliveRsp, error)
NodeKeepaliveV3 candidate and edge keepalive
func (*Scheduler) NodeRemoveAssetResult ¶
func (s *Scheduler) NodeRemoveAssetResult(ctx context.Context, resultInfo types.RemoveAssetResult) error
NodeRemoveAssetResult updates a node's disk usage and block count based on the resultInfo.
func (*Scheduler) NodeValidationResult ¶
NodeValidationResult processes the validation result for a node
func (*Scheduler) PerformSyncData ¶ added in v0.1.18
PerformSyncData synchronizes data for the specified node.
func (*Scheduler) ReDetermineNodeNATType ¶ added in v0.1.19
ReDetermineNodeNATType re-determines the NAT type for the specified node.
func (*Scheduler) RePullFailedAssets ¶
RePullFailedAssets retries the pull process for a list of failed assets
func (*Scheduler) RecompenseNodeProfit ¶ added in v0.1.22
func (s *Scheduler) RecompenseNodeProfit(ctx context.Context, nodeID, note string, profit float64) error
RecompenseNodeProfit processes the recompense profit for a given node.
func (*Scheduler) RedeployFailedProjects ¶ added in v0.1.19
RedeployFailedProjects retries the deploy process for a list of failed projects
func (*Scheduler) RegisterCandidateNode ¶ added in v0.1.19
func (s *Scheduler) RegisterCandidateNode(ctx context.Context, nodeID, publicKey, code string) (*types.ActivationDetail, error)
RegisterCandidateNode register node
func (*Scheduler) RegisterEdgeNode ¶ added in v0.1.11
func (s *Scheduler) RegisterEdgeNode(ctx context.Context, nodeID, publicKey string) (*types.ActivationDetail, error)
RegisterEdgeNode register edge node, return key
func (*Scheduler) RegisterNode ¶
func (s *Scheduler) RegisterNode(ctx context.Context, nodeID, publicKey string, nodeType types.NodeType) (*types.ActivationDetail, error)
RegisterNode register node
func (*Scheduler) RegisterNodeV2 ¶ added in v0.1.22
func (s *Scheduler) RegisterNodeV2(ctx context.Context, info types.NodeRegister) (*types.ActivationDetail, error)
RegisterNodeV2 register edge node, return key
func (*Scheduler) RemoveAssetRecord ¶
RemoveAssetRecord removes an asset record from the system by its CID.
func (*Scheduler) RemoveAssetRecords ¶ added in v0.1.22
RemoveAssetRecords removes an asset record from the system by its CID.
func (*Scheduler) RemoveAssetReplica ¶
RemoveAssetReplica removes an asset replica from the system by its CID and nodeID.
func (*Scheduler) RemoveCandidateCode ¶ added in v0.1.21
RemoveCandidateCode removes the candidate code information from the database.
func (*Scheduler) RemoveNodeFailedReplica ¶ added in v0.1.16
RemoveNodeFailedReplica removes failed replicas from nodes.
func (*Scheduler) RequestActivationCodes ¶ added in v0.1.10
func (s *Scheduler) RequestActivationCodes(ctx context.Context, nodeType types.NodeType, count int) ([]*types.NodeActivation, error)
RequestActivationCodes request node activation codes
func (*Scheduler) ResetAssetReplicaCount ¶ added in v0.1.22
ResetAssetReplicaCount resets the replica count for an asset with the specified CID
func (*Scheduler) ResetCandidateCode ¶ added in v0.1.21
ResetCandidateCode resets the candidate code for the specified node.
func (*Scheduler) SetTunserverURL ¶ added in v0.1.21
SetTunserverURL sets the Tunnel server URL for the specified node.
func (*Scheduler) ShareAssetV2 ¶ added in v0.1.22
func (s *Scheduler) ShareAssetV2(ctx context.Context, info *types.ShareAssetReq) (*types.ShareAssetRsp, error)
ShareAssetV2 shares the file
func (*Scheduler) StartProject ¶ added in v0.1.19
StartProject starts a project based on the provided request.
func (*Scheduler) StopAssetRecord ¶ added in v0.1.14
StopAssetRecord stop an asset record from the system by its CID.
func (*Scheduler) SubmitProjectReport ¶ added in v0.1.21
SubmitProjectReport submits a project report for the given request.
func (*Scheduler) SubmitWorkloadReport ¶ added in v0.1.18
func (s *Scheduler) SubmitWorkloadReport(ctx context.Context, workload *types.WorkloadRecordReq) error
SubmitWorkloadReport submits a workload report to the scheduler.
func (*Scheduler) SubmitWorkloadReportV2 ¶ added in v0.1.18
func (s *Scheduler) SubmitWorkloadReportV2(ctx context.Context, workload *types.WorkloadRecordReq) error
SubmitWorkloadReportV2 submits a workload report to the scheduler.
func (*Scheduler) SwitchFillDiskTimer ¶ added in v0.1.13
SwitchFillDiskTimer toggles the fill disk timer based on the open parameter.
func (*Scheduler) UndoNodeDeactivation ¶ added in v0.1.11
UndoNodeDeactivation is used to undo the deactivation of a node in the titan server. It allows the previously deactivated node to start serving requests again.
func (*Scheduler) UpdateAssetExpiration ¶
UpdateAssetExpiration resets the expiration time of an asset record based on the provided CID and new expiration time.
func (*Scheduler) UpdateBandwidths ¶ added in v0.1.11
UpdateBandwidths update bandwidths
func (*Scheduler) UpdateNodePort ¶
UpdateNodePort sets the port for the specified node.
func (*Scheduler) UpdateProject ¶ added in v0.1.19
UpdateProject updates a project with the given request.
func (*Scheduler) UpdateProjectStatus ¶ added in v0.1.19
UpdateProjectStatus updates the status of the projects in the scheduler.
func (*Scheduler) UserAssetDownloadResult ¶ added in v0.1.11
func (s *Scheduler) UserAssetDownloadResult(ctx context.Context, userID, cid string, totalTraffic, peakBandwidth int64) error
UserAssetDownloadResult download result
func (*Scheduler) UserAssetDownloadResultV2 ¶ added in v0.1.22
UserAssetDownloadResultV2 handles the download result for user assets. When a user downloads a file through a shared link, L1 will submit a report
func (*Scheduler) VerifyTokenWithLimitCount ¶ added in v0.1.11
func (s *Scheduler) VerifyTokenWithLimitCount(ctx context.Context, token string) (*types.JWTPayload, error)
VerifyTokenWithLimitCount verify token in limit count