C# Class Amazon.EC2.Import.ImageFileParts

显示文件 Open project: aws/aws-sdk-net Class Usage Examples

Private Properties

Property Type Description
FetchNextPartForUpload ImageFilePart
RegisterUploadFailure void

Public Methods

Method Description
ImageFileParts ( ) : System

Initializes an empty collection of parts

Private Methods

Method Description
FetchNextPartForUpload ( Stream imageFileStream, byte &buffer ) : ImageFilePart

Returns the next part to be uploaded, with its data loaded into the supplied buffer.

We want to serialize read access to the image file stream so that we do not 'thrash' or encounter problems with a non-seekable stream, but at the same time parallelize the part uploads. Reading the data prior to returning the part instance data satisfies this requirement.If an error occurs during a part upload, we currently cease yielding parts to all workers, causing them to expire cleanly 'asap'. This strategy allows us to change to a 'greedy' approach in future where we simply skip over the part in error and do as much uploading as we can before exit.

RegisterUploadFailure ( ) : void

Allows the upload threadpool workers to register that one or more parts failed to upload successfully.

Method Details

ImageFileParts() public method

Initializes an empty collection of parts
public ImageFileParts ( ) : System
return System