Documentation
¶
Index ¶
Constants ¶
const ( FileToBlock Definition = "file-blockblob" HTTPToBlock = "http-blockblob" BlobToFile = "blob-file" FileToPage = "file-pageblob" HTTPToPage = "http-pageblob" HTTPToFile = "http-file" )
The different transfers types
const DupeCheckLevelStr = "None, ZeroOnly, Full" //TODO: package this better so it can stay in sync w/declaration
DupeCheckLevelStr list of duplicate blob check strategies
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channels ¶
type Channels struct {
ReadParts chan pipeline.Part
Parts chan pipeline.Part
Results chan pipeline.WorkerResult
Partitions chan pipeline.PartsPartition
}
Channels represents all the control channels in the transfer.
type Definition ¶
type Definition string
Definition represents the supported source and target combinations
func ParseTransferDefinition ¶
func ParseTransferDefinition(str string) (Definition, error)
ParseTransferDefinition parses a Definition from a string.
type DupeCheckLevel ¶
type DupeCheckLevel int
DupeCheckLevel -- degree to which we'll try to check for duplicate blocks
const ( None DupeCheckLevel = iota // Don't bother to check ZeroOnly // Only check for blocks with all zero bytes Full // Compute MD5s and look for matches on that )
The different levels for duplicate blocks
func ParseDupeCheckLevel ¶
func ParseDupeCheckLevel(str string) (res DupeCheckLevel, err error)
ParseDupeCheckLevel converts string to DupeCheckLevel
func (*DupeCheckLevel) ToString ¶
func (d *DupeCheckLevel) ToString() string
ToString printable representation of duplicate level values. For now, handle error as fatal, shouldn't be possible
type ProgressUpdate ¶
type ProgressUpdate func(results pipeline.WorkerResult, committedCount int, bufferSize int)
ProgressUpdate called whenever a worker completes successfully
type StatInfo ¶
type StatInfo struct {
NumberOfFiles int
Duration time.Duration
TargetRetries int32
TotalNumberOfBlocks int
TotalSize uint64
CumWriteDuration time.Duration
}
StatInfo TODO
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats TODO
func (*Stats) AddTransferInfo ¶
AddTransferInfo TODO
type TimeStatsInfo ¶
type TimeStatsInfo struct {
StartTime time.Time
Duration time.Duration
CumWriteDuration time.Duration
}
TimeStatsInfo contains transfer statistics, used at the end of the transfer
type Transfer ¶
type Transfer struct {
SourcePipeline *pipeline.SourcePipeline
TargetPipeline *pipeline.TargetPipeline
NumOfReaders int
NumOfWorkers int
TotalNumOfBlocks int
TotalSize uint64
ThreadTarget int
SyncWaitGroups *WaitGroups
ControlChannels *Channels
TimeStats *TimeStatsInfo
// contains filtered or unexported fields
}
Transfer top data structure holding the state of the transfer.
func NewTransfer ¶
func NewTransfer(source *pipeline.SourcePipeline, target *pipeline.TargetPipeline, readers int, workers int, blockSize uint64) *Transfer
NewTransfer creates a new Transfer, this will adjust the thread target and initialize the channels and the wait groups for the writers, readers and the committers
func (*Transfer) StartTransfer ¶
func (t *Transfer) StartTransfer(dupeLevel DupeCheckLevel, progressBarDelegate ProgressUpdate)
StartTransfer starts the readers and readers. Process and commits the results of the write operations. The duration timer is started.
type WaitGroups ¶
WaitGroups holds all wait groups involved in the transfer.