Documentation ¶
Index ¶
- func InitTables(d *SQLDB, serverID dtypes.ServerID) error
- type DeploymentService
- type SQLDB
- func (m *SQLDB) AddDomain(ctx context.Context, domain *types.DeploymentDomain) error
- func (m *SQLDB) AddNewProvider(ctx context.Context, provider *types.Provider) error
- func (n *SQLDB) AddNodeProfit(profitInfo *types.ProfitDetails) error
- func (m *SQLDB) AddProperties(ctx context.Context, properties *types.Properties) error
- func (n *SQLDB) AssetExists(hash string, serverID dtypes.ServerID) (bool, error)
- func (n *SQLDB) CleanData() error
- func (m *SQLDB) CreateDeployment(ctx context.Context, deployment *types.Deployment) error
- func (n *SQLDB) DeleteAssetRecordsOfNode(nodeID string) error
- func (n *SQLDB) DeleteAssetReplica(hash, nodeID string) error
- func (n *SQLDB) DeleteAssetsView(nodeID string) error
- func (n *SQLDB) DeleteBucket(bucketID string) error
- func (n *SQLDB) DeleteCandidateCodeInfo(code string) error
- func (m *SQLDB) DeleteDeployment(ctx context.Context, id types.DeploymentID) error
- func (m *SQLDB) DeleteDomain(ctx context.Context, name string) error
- func (n *SQLDB) DeleteEdgeUpdateConfig(nodeType int) error
- func (n *SQLDB) DeleteNodeInfo(nodeID string) error
- func (n *SQLDB) DeleteProjectInfo(serverID dtypes.ServerID, id string) error
- func (n *SQLDB) DeleteProjectReplica(id, nodeID string, event types.ProjectEvent) error
- func (n *SQLDB) DeleteReplenishBackup(hash string) error
- func (n *SQLDB) DeleteReplicaOfTimeout(statuses, hs []string) error
- func (n *SQLDB) DeleteUnfinishedProjectReplicas(id string) error
- func (n *SQLDB) DeleteUnfinishedReplicas(hash string) error
- func (m *SQLDB) GetAllProviders(ctx context.Context, option *types.GetProviderOption) ([]*types.Provider, error)
- func (n *SQLDB) GetCandidateCodeInfo(code string) (*types.CandidateCodeInfo, error)
- func (n *SQLDB) GetCandidateCodeInfoForNodeID(nodeID string) (*types.CandidateCodeInfo, error)
- func (n *SQLDB) GetCandidateCodeInfos() ([]*types.CandidateCodeInfo, error)
- func (m *SQLDB) GetDeploymentById(ctx context.Context, id types.DeploymentID) (*types.Deployment, error)
- func (m *SQLDB) GetDeployments(ctx context.Context, option *types.GetDeploymentOption) (int64, []*types.Deployment, error)
- func (m *SQLDB) GetDomain(ctx context.Context, hostname string) (*types.DeploymentDomain, error)
- func (n *SQLDB) GetNodePullingCount(serverID dtypes.ServerID, nodeID string, statuses []string) (int64, error)
- func (n *SQLDB) GetOnlineCount(node string, date time.Time) (int, error)
- func (m *SQLDB) GetProviderById(ctx context.Context, id string) (*types.Provider, error)
- func (n *SQLDB) IsValidator(nodeID string) (bool, error)
- func (n *SQLDB) ListAWSData(limit, offset int, isDistribute bool) ([]*types.AWSDataInfo, error)
- func (n *SQLDB) LoadAWSData(bucket string) (*types.AWSDataInfo, error)
- func (n *SQLDB) LoadAllAssetRecords(serverID dtypes.ServerID, limit, offset int, statuses []string) (*sqlx.Rows, error)
- func (n *SQLDB) LoadAllHashesOfNode(nodeID string) ([]string, error)
- func (n *SQLDB) LoadAllProjectInfos(serverID dtypes.ServerID, limit, offset int, statuses []string) (*sqlx.Rows, error)
- func (n *SQLDB) LoadAllReplicasByNodeID(nodeID string, limit, offset int, statues []types.ReplicaStatus) (*types.ListNodeReplicaRsp, error)
- func (n *SQLDB) LoadAssetCount(serverID dtypes.ServerID, filterState string) (int, error)
- func (n *SQLDB) LoadAssetRecord(hash string) (*types.AssetRecord, error)
- func (n *SQLDB) LoadAssetRecords(statuses []string, limit, offset int, serverID dtypes.ServerID) (*sqlx.Rows, error)
- func (n *SQLDB) LoadAssetStateInfo(hash string, serverID dtypes.ServerID) (*types.AssetStateInfo, error)
- func (n *SQLDB) LoadBucket(bucketID string) ([]byte, error)
- func (n *SQLDB) LoadBucketHashes(nodeID string) ([]byte, error)
- func (n *SQLDB) LoadCreateValidationResultInfos() ([]*types.ValidationResultInfo, error)
- func (n *SQLDB) LoadDeactivateNodeTime(nodeID string) (int64, error)
- func (n *SQLDB) LoadDeactivateNodes(time int64) ([]string, error)
- func (n *SQLDB) LoadEdgeUpdateConfigs() (map[int]*api.EdgeUpdateConfig, error)
- func (n *SQLDB) LoadExpiredAssetRecords(serverID dtypes.ServerID, statuses []string) ([]*types.AssetRecord, error)
- func (n *SQLDB) LoadFailedReplicas() ([]*types.ReplicaInfo, error)
- func (n *SQLDB) LoadFreeUpDiskTime(nodeID string) (time.Time, error)
- func (n *SQLDB) LoadNeedRefillAssetRecords(serverID dtypes.ServerID, replicas int64, status string) (*types.AssetRecord, error)
- func (n *SQLDB) LoadNodeActivationKey(nodeID string) (string, error)
- func (n *SQLDB) LoadNodeInfo(nodeID string) (*types.NodeInfo, error)
- func (n *SQLDB) LoadNodeInfos(limit, offset int) (*sqlx.Rows, int64, error)
- func (n *SQLDB) LoadNodeInfosOfType(nodeType int) ([]*types.NodeInfo, error)
- func (n *SQLDB) LoadNodeLastSeenTime(nodeID string) (time.Time, error)
- func (n *SQLDB) LoadNodeProfits(nodeID string, limit, offset int, ts []int) (*types.ListNodeProfitDetailsRsp, error)
- func (n *SQLDB) LoadNodePublicKey(nodeID string) (string, error)
- func (n *SQLDB) LoadNodeType(nodeID string) (types.NodeType, error)
- func (n *SQLDB) LoadNodeValidationInfo(roundID, nodeID string) (*types.ValidationResultInfo, error)
- func (n *SQLDB) LoadNodesOfPullingReplica(hash string) ([]string, error)
- func (n *SQLDB) LoadNodesOfStartingReplica(id string) ([]string, error)
- func (n *SQLDB) LoadProjectCount(serverID dtypes.ServerID, filterState string) (int, error)
- func (n *SQLDB) LoadProjectInfo(id string) (*types.ProjectInfo, error)
- func (n *SQLDB) LoadProjectInfos(serverID dtypes.ServerID, userID string, limit, offset int) ([]*types.ProjectInfo, error)
- func (n *SQLDB) LoadProjectReplicaInfo(id, nodeID string) (*types.ProjectReplicas, error)
- func (n *SQLDB) LoadProjectReplicaInfos(id string) ([]*types.ProjectReplicas, error)
- func (n *SQLDB) LoadProjectReplicasForNode(nodeID string) ([]*types.ProjectReplicas, error)
- func (n *SQLDB) LoadProjectStateInfo(id string, serverID dtypes.ServerID) (*types.ProjectStateInfo, error)
- func (n *SQLDB) LoadRecords(statuses []string, serverID dtypes.ServerID) ([]*types.AssetRecord, error)
- func (n *SQLDB) LoadReplenishBackups(limit int) ([]string, error)
- func (n *SQLDB) LoadReplicaEvents(start, end time.Time, limit, offset int) (*types.ListReplicaEventRsp, error)
- func (n *SQLDB) LoadReplicaEventsOfNode(nodeID string, limit, offset int) (*types.ListReplicaEventRsp, error)
- func (n *SQLDB) LoadReplicaSizeByNodeID(nodeID string) (int64, error)
- func (n *SQLDB) LoadReplicasByHash(hash string, limit, offset int) (*types.ListReplicaRsp, error)
- func (n *SQLDB) LoadReplicasByStatus(hash string, statuses []types.ReplicaStatus) ([]*types.ReplicaInfo, error)
- func (n *SQLDB) LoadRetrieveEvent(tokenID string) (*types.RetrieveEvent, error)
- func (n *SQLDB) LoadRetrieveEventRecords(nodeID string, limit, offset int) (*types.ListRetrieveEventRsp, error)
- func (n *SQLDB) LoadSucceedReplicasByNodeID(nodeID string, limit, offset int) (*types.ListNodeAssetRsp, error)
- func (n *SQLDB) LoadSyncTime(nodeID string) (time.Time, error)
- func (n *SQLDB) LoadTodayProfitsForNode(nodeID string, startTime, endTime time.Time) (float64, error)
- func (n *SQLDB) LoadTopHash(nodeID string) (string, error)
- func (n *SQLDB) LoadUnCalculatedValidationResults(maxTime time.Time, limit int) (*sqlx.Rows, error)
- func (n *SQLDB) LoadUnSavedValidationResults(limit int) (*sqlx.Rows, error)
- func (n *SQLDB) LoadValidationResultInfos(nodeID string, limit, offset int) (*types.ListValidationResultRsp, error)
- func (n *SQLDB) LoadValidators(serverID dtypes.ServerID) ([]string, error)
- func (n *SQLDB) LoadWSServerID(nodeID string) (string, error)
- func (n *SQLDB) LoadWorkloadRecord(workload *types.WorkloadRecord) ([]*types.WorkloadRecord, error)
- func (n *SQLDB) LoadWorkloadRecordOfID(workloadID string) (*types.WorkloadRecord, error)
- func (n *SQLDB) LoadWorkloadRecords(nodeID string, limit, offset int) (*types.ListWorkloadRecordRsp, error)
- func (n *SQLDB) NodeExists(nodeID string) error
- func (n *SQLDB) NodeExistsFromType(nodeID string, nodeType types.NodeType) error
- func (n *SQLDB) ProjectExists(id string, serverID dtypes.ServerID) (bool, error)
- func (n *SQLDB) RegisterCount(ip string) (int, error)
- func (n *SQLDB) RemoveInvalidValidationResult(sIDs []int) error
- func (n *SQLDB) ResetCandidateCodeInfo(code, nodeID string) error
- func (n *SQLDB) SaveAWSData(infos []types.AWSDataInfo) error
- func (n *SQLDB) SaveAssetRecord(rInfo *types.AssetRecord) error
- func (n *SQLDB) SaveAssetsView(nodeID string, topHash string, bucketHashes []byte) error
- func (n *SQLDB) SaveBucket(bucketID string, assetHashes []byte) error
- func (n *SQLDB) SaveCandidateCodeInfo(infos []*types.CandidateCodeInfo) error
- func (n *SQLDB) SaveDeactivateNode(nodeID string, time int64, penaltyPoint float64) error
- func (n *SQLDB) SaveEdgeUpdateConfig(info *api.EdgeUpdateConfig) error
- func (n *SQLDB) SaveFreeUpDiskTime(nodeID string, time time.Time) error
- func (n *SQLDB) SaveNodeInfo(info *types.NodeInfo) error
- func (n *SQLDB) SaveNodePublicKey(pKey, nodeID string) error
- func (n *SQLDB) SaveNodeRegisterInfos(details []*types.ActivationDetail) error
- func (n *SQLDB) SaveProjectInfo(info *types.ProjectInfo) error
- func (n *SQLDB) SaveProjectReplicasInfo(info *types.ProjectReplicas) error
- func (n *SQLDB) SaveReplenishBackup(hashes []string) error
- func (n *SQLDB) SaveReplicaEvent(hash, cid, nodeID string, size int64, expiration time.Time, ...) error
- func (n *SQLDB) SaveReplicaStatus(info *types.ReplicaInfo) error
- func (n *SQLDB) SaveReplicasStatus(infos []*types.ReplicaInfo) error
- func (n *SQLDB) SaveRetrieveEventInfo(cInfo *types.RetrieveEvent) error
- func (n *SQLDB) SaveValidationResultInfos(infos []*types.ValidationResultInfo) error
- func (n *SQLDB) SaveWSServerID(nodeID, wID string) error
- func (n *SQLDB) SaveWorkloadRecord(records []*types.WorkloadRecord) error
- func (n *SQLDB) UpdateAWSData(info *types.AWSDataInfo) error
- func (n *SQLDB) UpdateAssetInfo(hash, state string, totalBlock, totalSize, retryCount, replenishReplicas int64, ...) error
- func (n *SQLDB) UpdateAssetRecordExpiration(hash string, eTime time.Time) error
- func (n *SQLDB) UpdateAssetRecordReplicaCount(cid string, count int) error
- func (n *SQLDB) UpdateCandidateCodeInfo(code, nodeID string) error
- func (n *SQLDB) UpdateFileSavedStatus(ids []int) error
- func (n *SQLDB) UpdateNodeDynamicInfo(infos []*types.NodeDynamicInfo) ([]string, error)
- func (n *SQLDB) UpdateNodePenalty(nodePns map[string]float64) error
- func (n *SQLDB) UpdateOnlineCount(nodes []string, countIncr int, date time.Time) error
- func (n *SQLDB) UpdatePortMapping(nodeID, port string) error
- func (n *SQLDB) UpdateProjectInfo(info *types.ProjectInfo) error
- func (n *SQLDB) UpdateProjectReplicaStatusFromNode(nodeID string, uuids []string, status types.ProjectReplicaStatus) error
- func (n *SQLDB) UpdateProjectReplicaStatusToFailed(id string, nodes []string) error
- func (n *SQLDB) UpdateProjectReplicasStatusToFailed(id string) error
- func (n *SQLDB) UpdateProjectStateInfo(id, state string, retryCount, replenishReplicas int64, ...) error
- func (m *SQLDB) UpdateProviderState(ctx context.Context, id string, state types.ProviderState) error
- func (n *SQLDB) UpdateReplicaInfo(cInfo *types.ReplicaInfo) error
- func (n *SQLDB) UpdateReplicasStatusToFailed(hash string) error
- func (n *SQLDB) UpdateSyncTime(nodeID string) error
- func (n *SQLDB) UpdateValidationResultInfo(info *types.ValidationResultInfo) error
- func (n *SQLDB) UpdateValidationResultStatus(roundID, nodeID string, status types.ValidationStatus) error
- func (n *SQLDB) UpdateValidatorInfo(serverID dtypes.ServerID, nodeID string) error
- func (n *SQLDB) UpdateValidators(nodeIDs []string, serverID dtypes.ServerID, cleanOld bool) error
- func (n *SQLDB) UpdateWorkloadRecord(record *types.WorkloadRecord, status types.WorkloadStatus) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DeploymentService ¶ added in v0.1.21
type DeploymentService struct { types.Deployment types.Service `db:"service"` }
type SQLDB ¶
type SQLDB struct {
// contains filtered or unexported fields
}
SQLDB represents a scheduler sql database.
func (*SQLDB) AddNewProvider ¶ added in v0.1.21
func (*SQLDB) AddNodeProfit ¶ added in v0.1.19
func (n *SQLDB) AddNodeProfit(profitInfo *types.ProfitDetails) error
func (*SQLDB) AddProperties ¶ added in v0.1.21
func (*SQLDB) AssetExists ¶
AssetExists checks if an asset exists in the state machine table of the specified server.
func (*SQLDB) CreateDeployment ¶ added in v0.1.21
func (*SQLDB) DeleteAssetRecordsOfNode ¶ added in v0.1.11
DeleteAssetRecordsOfNode clean asset records of node
func (*SQLDB) DeleteAssetReplica ¶
DeleteAssetReplica remove a replica associated with a given asset hash from the database.
func (*SQLDB) DeleteAssetsView ¶
DeleteAssetsView delete the asset view for node
func (*SQLDB) DeleteBucket ¶
DeleteBucket delete the bucket
func (*SQLDB) DeleteCandidateCodeInfo ¶ added in v0.1.19
DeleteCandidateCodeInfo code info
func (*SQLDB) DeleteDeployment ¶ added in v0.1.21
func (*SQLDB) DeleteDomain ¶ added in v0.1.21
func (*SQLDB) DeleteEdgeUpdateConfig ¶
DeleteEdgeUpdateConfig delete edge update info
func (*SQLDB) DeleteNodeInfo ¶
DeleteNodeInfo delete Node info
func (*SQLDB) DeleteProjectInfo ¶ added in v0.1.19
DeleteProjectInfo deletes
func (*SQLDB) DeleteProjectReplica ¶ added in v0.1.19
func (n *SQLDB) DeleteProjectReplica(id, nodeID string, event types.ProjectEvent) error
DeleteProjectReplica deletes
func (*SQLDB) DeleteReplenishBackup ¶ added in v0.1.11
DeleteReplenishBackup delete
func (*SQLDB) DeleteReplicaOfTimeout ¶ added in v0.1.18
func (*SQLDB) DeleteUnfinishedProjectReplicas ¶ added in v0.1.19
DeleteUnfinishedProjectReplicas deletes the incomplete replicas with the given hash from the database.
func (*SQLDB) DeleteUnfinishedReplicas ¶
DeleteUnfinishedReplicas deletes the incomplete replicas with the given hash from the database.
func (*SQLDB) GetAllProviders ¶ added in v0.1.21
func (*SQLDB) GetCandidateCodeInfo ¶ added in v0.1.19
func (n *SQLDB) GetCandidateCodeInfo(code string) (*types.CandidateCodeInfo, error)
GetCandidateCodeInfo code info
func (*SQLDB) GetCandidateCodeInfoForNodeID ¶ added in v0.1.19
func (n *SQLDB) GetCandidateCodeInfoForNodeID(nodeID string) (*types.CandidateCodeInfo, error)
GetCandidateCodeInfoForNodeID code info
func (*SQLDB) GetCandidateCodeInfos ¶ added in v0.1.19
func (n *SQLDB) GetCandidateCodeInfos() ([]*types.CandidateCodeInfo, error)
GetCandidateCodeInfos code info
func (*SQLDB) GetDeploymentById ¶ added in v0.1.21
func (m *SQLDB) GetDeploymentById(ctx context.Context, id types.DeploymentID) (*types.Deployment, error)
func (*SQLDB) GetDeployments ¶ added in v0.1.21
func (m *SQLDB) GetDeployments(ctx context.Context, option *types.GetDeploymentOption) (int64, []*types.Deployment, error)
func (*SQLDB) GetNodePullingCount ¶ added in v0.1.15
func (n *SQLDB) GetNodePullingCount(serverID dtypes.ServerID, nodeID string, statuses []string) (int64, error)
GetNodePullingCount
func (*SQLDB) GetOnlineCount ¶ added in v0.1.19
GetOnlineCount
func (*SQLDB) GetProviderById ¶ added in v0.1.21
func (*SQLDB) IsValidator ¶
IsValidator Determine whether the node is a validator
func (*SQLDB) ListAWSData ¶ added in v0.1.13
ListAWSData
func (*SQLDB) LoadAWSData ¶ added in v0.1.13
func (n *SQLDB) LoadAWSData(bucket string) (*types.AWSDataInfo, error)
LoadAWSData
func (*SQLDB) LoadAllAssetRecords ¶
func (n *SQLDB) LoadAllAssetRecords(serverID dtypes.ServerID, limit, offset int, statuses []string) (*sqlx.Rows, error)
LoadAllAssetRecords loads all asset records for a given server ID.
func (*SQLDB) LoadAllHashesOfNode ¶ added in v0.1.11
LoadAllHashesOfNode load asset replica information based on node.
func (*SQLDB) LoadAllProjectInfos ¶ added in v0.1.19
func (n *SQLDB) LoadAllProjectInfos(serverID dtypes.ServerID, limit, offset int, statuses []string) (*sqlx.Rows, error)
LoadAllProjectInfos loads all project records for a given server ID.
func (*SQLDB) LoadAllReplicasByNodeID ¶ added in v0.1.16
func (n *SQLDB) LoadAllReplicasByNodeID(nodeID string, limit, offset int, statues []types.ReplicaStatus) (*types.ListNodeReplicaRsp, error)
LoadAllReplicasByNodeID load replicas of node.
func (*SQLDB) LoadAssetCount ¶
LoadAssetCount count asset
func (*SQLDB) LoadAssetRecord ¶
func (n *SQLDB) LoadAssetRecord(hash string) (*types.AssetRecord, error)
LoadAssetRecord load asset record information
func (*SQLDB) LoadAssetRecords ¶
func (n *SQLDB) LoadAssetRecords(statuses []string, limit, offset int, serverID dtypes.ServerID) (*sqlx.Rows, error)
LoadAssetRecords load the asset records from the incoming scheduler
func (*SQLDB) LoadAssetStateInfo ¶ added in v0.1.10
func (n *SQLDB) LoadAssetStateInfo(hash string, serverID dtypes.ServerID) (*types.AssetStateInfo, error)
LoadAssetStateInfo loads the state of the asset for a given server ID.
func (*SQLDB) LoadBucket ¶
LoadBucket load assets ids from bucket return hashes of asset
func (*SQLDB) LoadBucketHashes ¶
LoadBucketHashes load assets view buckets hashes
func (*SQLDB) LoadCreateValidationResultInfos ¶ added in v0.1.16
func (n *SQLDB) LoadCreateValidationResultInfos() ([]*types.ValidationResultInfo, error)
LoadCreateValidationResultInfos load validation results.
func (*SQLDB) LoadDeactivateNodeTime ¶ added in v0.1.11
LoadDeactivateNodeTime Get node deactivate time
func (*SQLDB) LoadDeactivateNodes ¶ added in v0.1.11
LoadDeactivateNodes load all deactivate node.
func (*SQLDB) LoadEdgeUpdateConfigs ¶
func (n *SQLDB) LoadEdgeUpdateConfigs() (map[int]*api.EdgeUpdateConfig, error)
LoadEdgeUpdateConfigs load edge update information.
func (*SQLDB) LoadExpiredAssetRecords ¶
func (n *SQLDB) LoadExpiredAssetRecords(serverID dtypes.ServerID, statuses []string) ([]*types.AssetRecord, error)
LoadExpiredAssetRecords load all expired asset records based on serverID.
func (*SQLDB) LoadFailedReplicas ¶ added in v0.1.16
func (n *SQLDB) LoadFailedReplicas() ([]*types.ReplicaInfo, error)
LoadFailedReplicas load replicas .
func (*SQLDB) LoadFreeUpDiskTime ¶ added in v0.1.19
LoadFreeUpDiskTime Get free up disk time
func (*SQLDB) LoadNeedRefillAssetRecords ¶ added in v0.1.13
func (n *SQLDB) LoadNeedRefillAssetRecords(serverID dtypes.ServerID, replicas int64, status string) (*types.AssetRecord, error)
LoadNeedRefillAssetRecords loads
func (*SQLDB) LoadNodeActivationKey ¶ added in v0.1.10
LoadNodeActivationKey load activation key of node.
func (*SQLDB) LoadNodeInfo ¶
LoadNodeInfo load node information.
func (*SQLDB) LoadNodeInfos ¶
LoadNodeInfos load nodes information.
func (*SQLDB) LoadNodeInfosOfType ¶ added in v0.1.19
LoadNodeInfosOfType load node infos
func (*SQLDB) LoadNodeLastSeenTime ¶
LoadNodeLastSeenTime loads the last seen time of a node
func (*SQLDB) LoadNodeProfits ¶ added in v0.1.18
func (n *SQLDB) LoadNodeProfits(nodeID string, limit, offset int, ts []int) (*types.ListNodeProfitDetailsRsp, error)
LoadNodeProfits load profit info.
func (*SQLDB) LoadNodePublicKey ¶
LoadNodePublicKey load public key of node.
func (*SQLDB) LoadNodeType ¶
LoadNodeType load type of node.
func (*SQLDB) LoadNodeValidationInfo ¶
func (n *SQLDB) LoadNodeValidationInfo(roundID, nodeID string) (*types.ValidationResultInfo, error)
LoadNodeValidationInfo load the cid of a validation result.
func (*SQLDB) LoadNodesOfPullingReplica ¶ added in v0.1.16
LoadNodesOfPullingReplica
func (*SQLDB) LoadNodesOfStartingReplica ¶ added in v0.1.19
LoadNodesOfStartingReplica
func (*SQLDB) LoadProjectCount ¶ added in v0.1.19
LoadProjectCount count project
func (*SQLDB) LoadProjectInfo ¶ added in v0.1.19
func (n *SQLDB) LoadProjectInfo(id string) (*types.ProjectInfo, error)
LoadProjectInfo load project record information
func (*SQLDB) LoadProjectInfos ¶ added in v0.1.19
func (n *SQLDB) LoadProjectInfos(serverID dtypes.ServerID, userID string, limit, offset int) ([]*types.ProjectInfo, error)
LoadProjectInfos load project record information
func (*SQLDB) LoadProjectReplicaInfo ¶ added in v0.1.21
func (n *SQLDB) LoadProjectReplicaInfo(id, nodeID string) (*types.ProjectReplicas, error)
LoadProjectReplicaInfo load project replica information based on id
func (*SQLDB) LoadProjectReplicaInfos ¶ added in v0.1.21
func (n *SQLDB) LoadProjectReplicaInfos(id string) ([]*types.ProjectReplicas, error)
LoadProjectReplicaInfos load project replica information based on id
func (*SQLDB) LoadProjectReplicasForNode ¶ added in v0.1.19
func (n *SQLDB) LoadProjectReplicasForNode(nodeID string) ([]*types.ProjectReplicas, error)
LoadProjectReplicasForNode load project replica information based on node
func (*SQLDB) LoadProjectStateInfo ¶ added in v0.1.19
func (n *SQLDB) LoadProjectStateInfo(id string, serverID dtypes.ServerID) (*types.ProjectStateInfo, error)
LoadProjectStateInfo loads the state of the project for a given server ID.
func (*SQLDB) LoadRecords ¶ added in v0.1.18
func (n *SQLDB) LoadRecords(statuses []string, serverID dtypes.ServerID) ([]*types.AssetRecord, error)
LoadRecords load the asset records from the incoming scheduler
func (*SQLDB) LoadReplenishBackups ¶ added in v0.1.11
LoadReplenishBackups load asset replica information
func (*SQLDB) LoadReplicaEvents ¶ added in v0.1.10
func (n *SQLDB) LoadReplicaEvents(start, end time.Time, limit, offset int) (*types.ListReplicaEventRsp, error)
LoadReplicaEvents Load replica event
func (*SQLDB) LoadReplicaEventsOfNode ¶ added in v0.1.11
func (n *SQLDB) LoadReplicaEventsOfNode(nodeID string, limit, offset int) (*types.ListReplicaEventRsp, error)
LoadReplicaEventsOfNode Load replica event
func (*SQLDB) LoadReplicaSizeByNodeID ¶ added in v0.1.13
LoadReplicaSizeByNodeID load size of node.
func (*SQLDB) LoadReplicasByHash ¶
LoadReplicasByHash load replicas of asset hash.
func (*SQLDB) LoadReplicasByStatus ¶ added in v0.1.10
func (n *SQLDB) LoadReplicasByStatus(hash string, statuses []types.ReplicaStatus) ([]*types.ReplicaInfo, error)
LoadReplicasByStatus load asset replica information based on hash and statuses.
func (*SQLDB) LoadRetrieveEvent ¶ added in v0.1.11
func (n *SQLDB) LoadRetrieveEvent(tokenID string) (*types.RetrieveEvent, error)
LoadRetrieveEvent load retrieve event
func (*SQLDB) LoadRetrieveEventRecords ¶ added in v0.1.11
func (n *SQLDB) LoadRetrieveEventRecords(nodeID string, limit, offset int) (*types.ListRetrieveEventRsp, error)
LoadRetrieveEventRecords Load retrieve events
func (*SQLDB) LoadSucceedReplicasByNodeID ¶ added in v0.1.16
func (n *SQLDB) LoadSucceedReplicasByNodeID(nodeID string, limit, offset int) (*types.ListNodeAssetRsp, error)
LoadSucceedReplicasByNodeID load replicas of node.
func (*SQLDB) LoadSyncTime ¶ added in v0.1.10
LoadSyncTime load assets view sync time
func (*SQLDB) LoadTodayProfitsForNode ¶ added in v0.1.19
func (*SQLDB) LoadTopHash ¶
LoadTopHash load assets view top hash
func (*SQLDB) LoadUnCalculatedValidationResults ¶ added in v0.1.10
LoadUnCalculatedValidationResults Load not calculated profit validation results
func (*SQLDB) LoadUnSavedValidationResults ¶ added in v0.1.10
LoadUnSavedValidationResults Load not save to file validation results
func (*SQLDB) LoadValidationResultInfos ¶
func (n *SQLDB) LoadValidationResultInfos(nodeID string, limit, offset int) (*types.ListValidationResultRsp, error)
LoadValidationResultInfos load validation results.
func (*SQLDB) LoadValidators ¶
LoadValidators load validators information.
func (*SQLDB) LoadWSServerID ¶ added in v0.1.19
LoadWSServerID
func (*SQLDB) LoadWorkloadRecord ¶ added in v0.1.10
func (n *SQLDB) LoadWorkloadRecord(workload *types.WorkloadRecord) ([]*types.WorkloadRecord, error)
LoadWorkloadRecord load workload record
func (*SQLDB) LoadWorkloadRecordOfID ¶ added in v0.1.18
func (n *SQLDB) LoadWorkloadRecordOfID(workloadID string) (*types.WorkloadRecord, error)
LoadWorkloadRecordOfID load workload record
func (*SQLDB) LoadWorkloadRecords ¶ added in v0.1.10
func (n *SQLDB) LoadWorkloadRecords(nodeID string, limit, offset int) (*types.ListWorkloadRecordRsp, error)
LoadWorkloadRecords Load workload records
func (*SQLDB) NodeExists ¶
NodeExists is node exists
func (*SQLDB) NodeExistsFromType ¶ added in v0.1.21
NodeExistsFromType is node exists
func (*SQLDB) ProjectExists ¶ added in v0.1.19
ProjectExists checks if an project exists in the state machine table of the specified server.
func (*SQLDB) RegisterCount ¶ added in v0.1.13
TodayRegisterCount get the number of registrations for this ip today
func (*SQLDB) RemoveInvalidValidationResult ¶ added in v0.1.11
RemoveInvalidValidationResult Remove invalid validation results
func (*SQLDB) ResetCandidateCodeInfo ¶ added in v0.1.21
ResetCandidateCodeInfo code info
func (*SQLDB) SaveAWSData ¶ added in v0.1.13
func (n *SQLDB) SaveAWSData(infos []types.AWSDataInfo) error
SaveAWSData save data
func (*SQLDB) SaveAssetRecord ¶
func (n *SQLDB) SaveAssetRecord(rInfo *types.AssetRecord) error
SaveAssetRecord saves an asset record into the database.
func (*SQLDB) SaveAssetsView ¶
SaveAssetsView update or insert top hash and buckets hashes to assets view bucketHashes key is number of bucket, value is bucket hash TODO save bucketHashes as array
func (*SQLDB) SaveBucket ¶
SaveBucket update or insert assets ids to bucket
func (*SQLDB) SaveCandidateCodeInfo ¶ added in v0.1.19
func (n *SQLDB) SaveCandidateCodeInfo(infos []*types.CandidateCodeInfo) error
SaveCandidateCodeInfo Insert Node code info
func (*SQLDB) SaveDeactivateNode ¶ added in v0.1.11
SaveDeactivateNode save deactivate node time
func (*SQLDB) SaveEdgeUpdateConfig ¶
func (n *SQLDB) SaveEdgeUpdateConfig(info *api.EdgeUpdateConfig) error
SaveEdgeUpdateConfig inserts edge update information.
func (*SQLDB) SaveFreeUpDiskTime ¶ added in v0.1.19
SaveFreeUpDiskTime save free up disk time
func (*SQLDB) SaveNodeInfo ¶
SaveNodeInfo Insert or update node info
func (*SQLDB) SaveNodePublicKey ¶ added in v0.1.10
SaveNodePublicKey update node public key
func (*SQLDB) SaveNodeRegisterInfos ¶ added in v0.1.10
func (n *SQLDB) SaveNodeRegisterInfos(details []*types.ActivationDetail) error
SaveNodeRegisterInfos Insert Node register info
func (*SQLDB) SaveProjectInfo ¶ added in v0.1.19
func (n *SQLDB) SaveProjectInfo(info *types.ProjectInfo) error
SaveProjectInfo inserts
func (*SQLDB) SaveProjectReplicasInfo ¶ added in v0.1.19
func (n *SQLDB) SaveProjectReplicasInfo(info *types.ProjectReplicas) error
SaveProjectReplicasInfo inserts
func (*SQLDB) SaveReplenishBackup ¶ added in v0.1.11
SaveReplenishBackup Save assets that require replenish backups
func (*SQLDB) SaveReplicaEvent ¶ added in v0.1.11
func (*SQLDB) SaveReplicaStatus ¶ added in v0.1.18
func (n *SQLDB) SaveReplicaStatus(info *types.ReplicaInfo) error
SaveReplicaStatus inserts or updates replicas status
func (*SQLDB) SaveReplicasStatus ¶ added in v0.1.10
func (n *SQLDB) SaveReplicasStatus(infos []*types.ReplicaInfo) error
SaveReplicasStatus inserts or updates replicas status
func (*SQLDB) SaveRetrieveEventInfo ¶ added in v0.1.11
func (n *SQLDB) SaveRetrieveEventInfo(cInfo *types.RetrieveEvent) error
SaveRetrieveEventInfo save retrieve event and update node info
func (*SQLDB) SaveValidationResultInfos ¶
func (n *SQLDB) SaveValidationResultInfos(infos []*types.ValidationResultInfo) error
SaveValidationResultInfos inserts validation result information.
func (*SQLDB) SaveWSServerID ¶ added in v0.1.19
SaveWSServerID save id
func (*SQLDB) SaveWorkloadRecord ¶ added in v0.1.10
func (n *SQLDB) SaveWorkloadRecord(records []*types.WorkloadRecord) error
SaveWorkloadRecord save workload record
func (*SQLDB) UpdateAWSData ¶ added in v0.1.13
func (n *SQLDB) UpdateAWSData(info *types.AWSDataInfo) error
UpdateAWSData update aws info
func (*SQLDB) UpdateAssetInfo ¶ added in v0.1.10
func (n *SQLDB) UpdateAssetInfo(hash, state string, totalBlock, totalSize, retryCount, replenishReplicas int64, serverID dtypes.ServerID) error
UpdateAssetInfo update asset information
func (*SQLDB) UpdateAssetRecordExpiration ¶ added in v0.1.10
UpdateAssetRecordExpiration resets asset record expiration time based on hash and eTime
func (*SQLDB) UpdateAssetRecordReplicaCount ¶ added in v0.1.14
UpdateAssetRecordReplicaCount
func (*SQLDB) UpdateCandidateCodeInfo ¶ added in v0.1.19
UpdateCandidateCodeInfo code info
func (*SQLDB) UpdateFileSavedStatus ¶ added in v0.1.10
UpdateFileSavedStatus update the file saved in validation result
func (*SQLDB) UpdateNodeDynamicInfo ¶ added in v0.1.19
func (n *SQLDB) UpdateNodeDynamicInfo(infos []*types.NodeDynamicInfo) ([]string, error)
UpdateNodeDynamicInfo update node online time , last time , disk usage ...
func (*SQLDB) UpdateNodePenalty ¶ added in v0.1.19
UpdateNodePenalty
func (*SQLDB) UpdateOnlineCount ¶ added in v0.1.19
func (*SQLDB) UpdatePortMapping ¶
UpdatePortMapping sets the node's mapping port.
func (*SQLDB) UpdateProjectInfo ¶ added in v0.1.19
func (n *SQLDB) UpdateProjectInfo(info *types.ProjectInfo) error
func (*SQLDB) UpdateProjectReplicaStatusFromNode ¶ added in v0.1.19
func (n *SQLDB) UpdateProjectReplicaStatusFromNode(nodeID string, uuids []string, status types.ProjectReplicaStatus) error
UpdateProjectReplicaStatusFromNode
func (*SQLDB) UpdateProjectReplicaStatusToFailed ¶ added in v0.1.19
UpdateProjectReplicaStatusToFailed
func (*SQLDB) UpdateProjectReplicasStatusToFailed ¶ added in v0.1.19
UpdateProjectReplicasStatusToFailed updates the status of unfinished project replicas
func (*SQLDB) UpdateProjectStateInfo ¶ added in v0.1.19
func (n *SQLDB) UpdateProjectStateInfo(id, state string, retryCount, replenishReplicas int64, serverID dtypes.ServerID) error
UpdateProjectStateInfo update project information
func (*SQLDB) UpdateProviderState ¶ added in v0.1.21
func (*SQLDB) UpdateReplicaInfo ¶ added in v0.1.10
func (n *SQLDB) UpdateReplicaInfo(cInfo *types.ReplicaInfo) error
UpdateReplicaInfo update unfinished replica info , return an error if the replica is finished
func (*SQLDB) UpdateReplicasStatusToFailed ¶
UpdateReplicasStatusToFailed updates the status of unfinished asset replicas
func (*SQLDB) UpdateSyncTime ¶ added in v0.1.10
UpdateSyncTime update assets view sync time
func (*SQLDB) UpdateValidationResultInfo ¶
func (n *SQLDB) UpdateValidationResultInfo(info *types.ValidationResultInfo) error
UpdateValidationResultInfo updates the validation result information.
func (*SQLDB) UpdateValidationResultStatus ¶ added in v0.1.16
func (n *SQLDB) UpdateValidationResultStatus(roundID, nodeID string, status types.ValidationStatus) error
UpdateValidationResultsTimeout sets the validation results' status as timeout.
func (*SQLDB) UpdateValidatorInfo ¶
UpdateValidatorInfo reset scheduler server id for validator
func (*SQLDB) UpdateValidators ¶
UpdateValidators update validators
func (*SQLDB) UpdateWorkloadRecord ¶ added in v0.1.10
func (n *SQLDB) UpdateWorkloadRecord(record *types.WorkloadRecord, status types.WorkloadStatus) error
UpdateWorkloadRecord update workload record