TransferSegmentMetadata Class

Definition

Represents metadata for a particular file segment.

public class TransferSegmentMetadata
type TransferSegmentMetadata = class
Public Class TransferSegmentMetadata
Inheritance
TransferSegmentMetadata

Properties

Length

Gets or sets a value indicating the size of the segment (in bytes).

Offset

Gets or sets a value indicating the starting offset of the segment in the file.

Path

Gets or sets a value indicating the stream path assigned to this segment.

SegmentNumber

Gets or sets a value indicating the number (sequence) of the segment in the file.

Status

Gets or sets a value indicating the current upload status for this segment.

Methods

CalculateSegmentCount(Int64)

Calculates the number of segments a file of the given length should be split into. The method to calculate this is based on some empirical measurements that allows both the number of segments and the length of each segment to grow as the input file size grows. They both grow on a logarithmic pattern as the file length increases. The formula is roughly this:

  • Multiplier = Min(100, 50 * 2 ^ Log10(FileLengthInGB))
  • SegmentCount = Max(1, Multiplier * 2 ^ Log10(FileLengthInGB) Essentially we quadruple the number of segments for each tenfold increase in the file length, with certain caps. The formula is designed to support both small files and extremely large files (and not cause very small segment lengths or very large number of segments).
CalculateSegmentLength(Int64, Int32)

Calculates the length of a typical (non-terminal) segment for a file of the given length that is split into the given number of segments.

Applies to