Documentation
¶
Overview ¶
Package cmn provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package downloader implements functionality to download resources into AIS cluster from external source.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package downloader implements functionality to download resources into AIS cluster from external source.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package downloader implements functionality to download resources into AIS cluster from external source.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package downloader implements functionality to download resources into AIS cluster from external source.
- Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
Package downloader implements functionality to download resources into AIS cluster from external source.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package downloader implements functionality to download resources into AIS cluster from external source.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package downloader implements functionality to download resources into AIS cluster from external source.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package cmn provides common low-level types and utilities for all aistore projects
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package downloader implements functionality to download resources into AIS cluster from external source.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package downloader implements functionality to download resources into AIS cluster from external source.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package downloader implements functionality to download resources into AIS cluster from external source.
- Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
Index ¶
- Constants
- func CompareObjects(lom *cluster.LOM, dst *DstElement) (equal bool, err error)
- func IsType(a string) bool
- func NormalizeObjName(objName string) (string, error)
- func SetDB(dbdrv kvdb.Driver)
- func Xreg()
- type BackendResource
- type DiffResolver
- func (dr *DiffResolver) Abort(err error)
- func (dr *DiffResolver) CloseDst()
- func (dr *DiffResolver) CloseSrc()
- func (dr *DiffResolver) Next() (DiffResolverResult, error)
- func (dr *DiffResolver) PushDst(v any)
- func (dr *DiffResolver) PushSrc(v any)
- func (dr *DiffResolver) Start()
- func (dr *DiffResolver) Stop()
- func (dr *DiffResolver) Stopped() bool
- type DiffResolverCtx
- type DiffResolverResult
- type DlAdminBody
- type DlBackendBody
- type DlBase
- type DlBody
- type DlJob
- type DlJobInfo
- type DlJobInfos
- type DlLimits
- type DlMultiBody
- type DlPostResp
- type DlRangeBody
- type DlSingleBody
- type DlSingleObj
- type DlStatusResp
- type DlType
- type Downloader
- func (d *Downloader) AbortJob(id string) (resp any, statusCode int, err error)
- func (d *Downloader) Download(dJob DlJob) (resp any, statusCode int, err error)
- func (d *Downloader) JobStatus(id string, onlyActive bool) (resp any, statusCode int, err error)
- func (d *Downloader) ListJobs(regex *regexp.Regexp) (resp any, statusCode int, err error)
- func (*Downloader) Name() string
- func (d *Downloader) RemoveJob(id string) (resp any, statusCode int, err error)
- func (d *Downloader) Run(*sync.WaitGroup)
- func (d *Downloader) Snap() cluster.XactSnap
- type DstElement
- type NotifDownload
- type NotifDownloadListerner
- type TaskDlInfo
- type TaskErrByName
- type TaskErrInfo
- type TaskInfoByName
- type WebResource
Constants ¶
const ( DiffResolverSend = iota DiffResolverRecv DiffResolverDelete DiffResolverSkip DiffResolverErr DiffResolverEOF )
Variables ¶
This section is empty.
Functions ¶
func CompareObjects ¶
func CompareObjects(lom *cluster.LOM, dst *DstElement) (equal bool, err error)
Use all available metadata including {size, version, ETag, MD5, CRC} to compare local object with its remote counterpart.
func NormalizeObjName ¶
Removes everything that goes after '?', eg. "?query=key..." so it will not be part of final object name.
Types ¶
type BackendResource ¶
type BackendResource struct {
ObjName string
}
type DiffResolver ¶
type DiffResolver struct {
// contains filtered or unexported fields
}
DiffResolver is entity that computes difference between two streams of objects. The streams are expected to be in sorted order.
func NewDiffResolver ¶
func NewDiffResolver(ctx DiffResolverCtx) *DiffResolver
func (*DiffResolver) Abort ¶
func (dr *DiffResolver) Abort(err error)
func (*DiffResolver) CloseDst ¶
func (dr *DiffResolver) CloseDst()
func (*DiffResolver) CloseSrc ¶
func (dr *DiffResolver) CloseSrc()
func (*DiffResolver) Next ¶
func (dr *DiffResolver) Next() (DiffResolverResult, error)
func (*DiffResolver) PushDst ¶
func (dr *DiffResolver) PushDst(v any)
func (*DiffResolver) PushSrc ¶
func (dr *DiffResolver) PushSrc(v any)
func (*DiffResolver) Start ¶
func (dr *DiffResolver) Start()
func (*DiffResolver) Stop ¶
func (dr *DiffResolver) Stop()
func (*DiffResolver) Stopped ¶
func (dr *DiffResolver) Stopped() bool
type DiffResolverCtx ¶
type DiffResolverResult ¶
type DiffResolverResult struct { Action uint8 Src *cluster.LOM Dst *DstElement Err error }
type DlAdminBody ¶
type DlAdminBody struct { ID string `json:"id"` Regex string `json:"regex"` OnlyActiveTasks bool `json:"only_active_tasks"` // Skips detailed info about tasks finished/errored }
Internal status/delete request body
func (*DlAdminBody) Validate ¶
func (b *DlAdminBody) Validate(requireID bool) error
type DlBackendBody ¶
type DlBackendBody struct { DlBase Sync bool `json:"sync"` Prefix string `json:"prefix"` Suffix string `json:"suffix"` }
Backend download request
func (*DlBackendBody) Describe ¶
func (b *DlBackendBody) Describe() string
func (*DlBackendBody) Validate ¶
func (b *DlBackendBody) Validate() error
type DlBase ¶
type DlBody ¶
type DlBody struct { Type DlType `json:"type"` json.RawMessage }
NOTE: Changing this structure requires changes in `MarshalJSON` and `UnmarshalJSON` methods.
func (DlBody) MarshalJSON ¶
func (*DlBody) UnmarshalJSON ¶
type DlJob ¶
type DlJob interface { ID() string Bck() *cmn.Bck Description() string Timeout() time.Duration ActiveStats() (*DlStatusResp, error) String() string Notif() cluster.Notif // notifications AddNotif(n cluster.Notif, job DlJob) // If total length (size) of download job is not known, -1 should be returned. Len() int // Determines if it requires also syncing. Sync() bool // contains filtered or unexported methods }
type DlJobInfo ¶
type DlJobInfo struct { ID string `json:"id"` Description string `json:"description"` FinishedCnt int `json:"finished_cnt"` ScheduledCnt int `json:"scheduled_cnt"` // tasks being processed or already processed by dispatched SkippedCnt int `json:"skipped_cnt"` // number of tasks skipped ErrorCnt int `json:"error_cnt"` Total int `json:"total"` // total number of tasks, negative if unknown AllDispatched bool `json:"all_dispatched"` // if true, dispatcher has already scheduled all tasks for given job Aborted bool `json:"aborted"` StartedTime time.Time `json:"started_time"` FinishedTime time.Time `json:"finished_time"` }
Summary info of the download job
func (DlJobInfo) DoneCnt ¶
DoneCnt returns number of tasks that have finished (either successfully or with an error).
func (DlJobInfo) JobFinished ¶
func (DlJobInfo) JobRunning ¶
func (DlJobInfo) PendingCnt ¶
PendingCnt returns number of tasks which are currently being processed.
type DlJobInfos ¶
type DlJobInfos []*DlJobInfo
func (DlJobInfos) Len ¶
func (d DlJobInfos) Len() int
func (DlJobInfos) Less ¶
func (d DlJobInfos) Less(i, j int) bool
func (DlJobInfos) Swap ¶
func (d DlJobInfos) Swap(i, j int)
type DlMultiBody ¶
Multi request
func (*DlMultiBody) Describe ¶
func (b *DlMultiBody) Describe() string
func (*DlMultiBody) ExtractPayload ¶
func (b *DlMultiBody) ExtractPayload() (cos.StrKVs, error)
func (*DlMultiBody) String ¶
func (b *DlMultiBody) String() string
func (*DlMultiBody) Validate ¶
func (b *DlMultiBody) Validate() error
type DlPostResp ¶
type DlPostResp struct {
ID string `json:"id"`
}
Download POST result returned to the user
type DlRangeBody ¶
Range request
func (*DlRangeBody) Describe ¶
func (b *DlRangeBody) Describe() string
func (*DlRangeBody) String ¶
func (b *DlRangeBody) String() string
func (*DlRangeBody) Validate ¶
func (b *DlRangeBody) Validate() error
type DlSingleBody ¶
type DlSingleBody struct { DlBase DlSingleObj }
Single request
func (*DlSingleBody) Describe ¶
func (b *DlSingleBody) Describe() string
func (*DlSingleBody) ExtractPayload ¶
func (b *DlSingleBody) ExtractPayload() (cos.StrKVs, error)
func (*DlSingleBody) String ¶
func (b *DlSingleBody) String() string
func (*DlSingleBody) Validate ¶
func (b *DlSingleBody) Validate() error
type DlSingleObj ¶
type DlSingleObj struct { ObjName string `json:"object_name"` Link string `json:"link"` FromRemote bool `json:"from_remote"` }
func (*DlSingleObj) Validate ¶
func (b *DlSingleObj) Validate() error
type DlStatusResp ¶
type DlStatusResp struct { DlJobInfo CurrentTasks []TaskDlInfo `json:"current_tasks,omitempty"` FinishedTasks []TaskDlInfo `json:"finished_tasks,omitempty"` Errs []TaskErrInfo `json:"download_errors,omitempty"` }
func (*DlStatusResp) Aggregate ¶
func (d *DlStatusResp) Aggregate(rhs DlStatusResp) *DlStatusResp
type Downloader ¶
type Downloader struct { xact.DemandBase // contains filtered or unexported fields }
Downloader implements xact.Demand interface. Upon getting requests via AIS download endpoint, Downloader dispatches these requests to the corresponding jogger.
func (*Downloader) AbortJob ¶
func (d *Downloader) AbortJob(id string) (resp any, statusCode int, err error)
func (*Downloader) Download ¶
func (d *Downloader) Download(dJob DlJob) (resp any, statusCode int, err error)
func (*Downloader) Name ¶
func (*Downloader) Name() string
func (*Downloader) RemoveJob ¶
func (d *Downloader) RemoveJob(id string) (resp any, statusCode int, err error)
func (*Downloader) Run ¶
func (d *Downloader) Run(*sync.WaitGroup)
func (*Downloader) Snap ¶
func (d *Downloader) Snap() cluster.XactSnap
type DstElement ¶
type NotifDownload ¶
func (*NotifDownload) ToNotifMsg ¶
func (nd *NotifDownload) ToNotifMsg() cluster.NotifMsg
type NotifDownloadListerner ¶
type NotifDownloadListerner struct {
nl.NotifListenerBase
}
func NewDownloadNL ¶
func (*NotifDownloadListerner) AbortArgs ¶
func (nd *NotifDownloadListerner) AbortArgs() cmn.HreqArgs
func (*NotifDownloadListerner) QueryArgs ¶
func (nd *NotifDownloadListerner) QueryArgs() cmn.HreqArgs
func (*NotifDownloadListerner) UnmarshalStats ¶
func (*NotifDownloadListerner) UnmarshalStats(rawMsg []byte) (stats any, finished, aborted bool, err error)
type TaskDlInfo ¶
type TaskDlInfo struct { Name string `json:"name"` Downloaded int64 `json:"downloaded,string"` Total int64 `json:"total,string,omitempty"` StartTime time.Time `json:"start_time,omitempty"` EndTime time.Time `json:"end_time,omitempty"` Running bool `json:"running"` }
Info about a task that is currently or has been downloaded by one of the joggers
type TaskErrByName ¶
type TaskErrByName []TaskErrInfo
func (TaskErrByName) Len ¶
func (t TaskErrByName) Len() int
func (TaskErrByName) Less ¶
func (t TaskErrByName) Less(i, j int) bool
func (TaskErrByName) Swap ¶
func (t TaskErrByName) Swap(i, j int)
type TaskErrInfo ¶
type TaskInfoByName ¶
type TaskInfoByName []TaskDlInfo
func (TaskInfoByName) Len ¶
func (t TaskInfoByName) Len() int
func (TaskInfoByName) Less ¶
func (t TaskInfoByName) Less(i, j int) bool
func (TaskInfoByName) Swap ¶
func (t TaskInfoByName) Swap(i, j int)