C# Class BlobSync.AzureOps

Inheritance: ICloudOps
Show file Open project: kpfaulkner/BlobSync Class Usage Examples

Public Methods

Method Description
CalculateDeltaSize ( string containerName, string blobName, string localFilePath ) : long
CalculateDeltaSizeFromLocalSig ( string localSigPath, string localFilePath ) : long
DefragBlob ( SizeBasedCompleteSignature blobSig, long maxUploadLimitMB = 2 ) : void

Merge smaller blocks into something at least fragmentMergeSize bytes long. Only upload at most maxUploadLimit (0 == no limit). Should this be in CommonOps? Lame... really? DEFRAG? Then again I suppose the term IS appropriate.

DefragBlob ( string filePath, long maxUploadLimitMB = 2 ) : void

Merge smaller blocks into something at least fragmentMergeSize bytes long. Only upload at most maxUploadLimit (0 == no limit). Should this be in CommonOps? Lame... really? DEFRAG? Then again I suppose the term IS appropriate.

DefragBlob ( string containerName, string blobName, long maxUploadLimitMB = 2 ) : void

Merge smaller blocks into something at least fragmentMergeSize bytes long. Only upload at most maxUploadLimit (0 == no limit). Should this be in CommonOps? Lame... really? DEFRAG? Then again I suppose the term IS appropriate.

DownloadBlob ( string containerName, string blobName, Stream stream, int parallelFactor = 2 ) : long
DownloadBlob ( string containerName, string blobName, string localFilePath, int parallelFactor = 2 ) : long
DownloadSignatureForBlob ( string container, string blobName ) : SizeBasedCompleteSignature
GenerateDeltaSigFromLocalResources ( string localSigPath, string localFilePath ) : SizeBasedCompleteSignature
GetBlockListInfo ( string containerName, string blobName ) : void
UploadFile ( string containerName, string blobName, string localFilePath, int parallelFactor = 2 ) : long
UploadSignatureForBlob ( string blobName, string containerName, SizeBasedCompleteSignature sig ) : void

Private Methods

Method Description
DefragSigGroup ( SizeBasedCompleteSignature blobSig, DefragNode sig ) : void
DownloadBytes ( string containerName, string blobName, long beginOffset, long endOffset, int parallelFactor = 2 ) : byte[]
FilterUploadedBlocks ( List allUploadedBlocks ) : void

Not currently used but DONT DELETE YET!!

GenerateByteRangesOfBlobToDownload ( List sigsToReuseList, SizeBasedCompleteSignature cloudBlobSig, string containerName, string blobName ) : List
GetBlobMD5 ( string containerName, string blobName ) : string
GetFileMD5 ( string localFilePath ) : string
PutBlockList ( string blockIdArray, string containerName, string blobName ) : void
ReadBlockBlob ( ICloudBlob blobRef, Stream stream, int parallelFactor = 2 ) : void
RegenerateBlob ( string containerName, string blobName, List byteRangesToDownload, string localFilePath, List reusableBlockSignatures, SizeBasedCompleteSignature blobSig, int parallelFactor = 2 ) : void
UploadBytes ( RemainingBytes remainingBytes, string localFilePath, string containerName, string blobName, bool testMode = false ) : List
UploadBytesParallel ( RemainingBytes remainingBytes, string localFilePath, string containerName, string blobName, bool testMode = false, int parallelFactor = 2 ) : List
UploadDelta ( string localFilePath, SignatureSearchResult searchResults, string containerName, string blobName, bool testMode = false, int parallelFactor = 2 ) : List
WriteBytes ( long offset, int bytesRead, byte bytesToRead, Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob blob, ConcurrentBag uploadedBlockList, bool testMode ) : System.Threading.Tasks.Task

Yes, copying the byte array to here. But given we'll not have many of these tasks going to parallel and each byte array is AT MOST 4M, I think I can live with the memory overhead.

Method Details

CalculateDeltaSize() public method

public CalculateDeltaSize ( string containerName, string blobName, string localFilePath ) : long
containerName string
blobName string
localFilePath string
return long

CalculateDeltaSizeFromLocalSig() public method

public CalculateDeltaSizeFromLocalSig ( string localSigPath, string localFilePath ) : long
localSigPath string
localFilePath string
return long

DefragBlob() public method

Merge smaller blocks into something at least fragmentMergeSize bytes long. Only upload at most maxUploadLimit (0 == no limit). Should this be in CommonOps? Lame... really? DEFRAG? Then again I suppose the term IS appropriate.
public DefragBlob ( SizeBasedCompleteSignature blobSig, long maxUploadLimitMB = 2 ) : void
blobSig BlobSync.Datatypes.SizeBasedCompleteSignature
maxUploadLimitMB long
return void

DefragBlob() public method

Merge smaller blocks into something at least fragmentMergeSize bytes long. Only upload at most maxUploadLimit (0 == no limit). Should this be in CommonOps? Lame... really? DEFRAG? Then again I suppose the term IS appropriate.
public DefragBlob ( string filePath, long maxUploadLimitMB = 2 ) : void
filePath string
maxUploadLimitMB long
return void

DefragBlob() public method

Merge smaller blocks into something at least fragmentMergeSize bytes long. Only upload at most maxUploadLimit (0 == no limit). Should this be in CommonOps? Lame... really? DEFRAG? Then again I suppose the term IS appropriate.
public DefragBlob ( string containerName, string blobName, long maxUploadLimitMB = 2 ) : void
containerName string
blobName string
maxUploadLimitMB long
return void

DownloadBlob() public method

public DownloadBlob ( string containerName, string blobName, Stream stream, int parallelFactor = 2 ) : long
containerName string
blobName string
stream Stream
parallelFactor int
return long

DownloadBlob() public method

public DownloadBlob ( string containerName, string blobName, string localFilePath, int parallelFactor = 2 ) : long
containerName string
blobName string
localFilePath string
parallelFactor int
return long

DownloadSignatureForBlob() public method

public DownloadSignatureForBlob ( string container, string blobName ) : SizeBasedCompleteSignature
container string
blobName string
return BlobSync.Datatypes.SizeBasedCompleteSignature

GenerateDeltaSigFromLocalResources() public method

public GenerateDeltaSigFromLocalResources ( string localSigPath, string localFilePath ) : SizeBasedCompleteSignature
localSigPath string
localFilePath string
return BlobSync.Datatypes.SizeBasedCompleteSignature

GetBlockListInfo() public method

public GetBlockListInfo ( string containerName, string blobName ) : void
containerName string
blobName string
return void

UploadFile() public method

public UploadFile ( string containerName, string blobName, string localFilePath, int parallelFactor = 2 ) : long
containerName string
blobName string
localFilePath string
parallelFactor int
return long

UploadSignatureForBlob() public method

public UploadSignatureForBlob ( string blobName, string containerName, SizeBasedCompleteSignature sig ) : void
blobName string
containerName string
sig BlobSync.Datatypes.SizeBasedCompleteSignature
return void