你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ParallelTransferOptions Class

  • java.lang.Object
    • com.azure.storage.common.ParallelTransferOptions

public final class ParallelTransferOptions

This class contains configuration used to parallelize data transfer operations. Note that not all values are used by every method which accepts this type. Please refer to the javadoc on specific methods for these cases.

Constructor Summary

Constructor Description
ParallelTransferOptions()

Creates a new ParallelTransferOptions with default parameters applied.

ParallelTransferOptions(Integer blockSize, Integer maxConcurrency, ProgressReceiver progressReceiver, Integer maxSingleUploadSize)

Deprecated

Use fluent interface to set properties instead.

Creates a new ParallelTransferOptions with default parameters applied.

Method Summary

Modifier and Type Method and Description
Integer getBlockSize()

Deprecated

Gets the block size (chunk size) to transfer at a time.

Long getBlockSizeLong()

Gets the block size (chunk size) to transfer at a time.

Integer getMaxConcurrency()

Gets the maximum number of parallel requests that will be issued at any given time.

Integer getMaxSingleUploadSize()

Deprecated

Gets the value above which the upload will be broken into blocks and parallelized.

Long getMaxSingleUploadSizeLong()

Gets the value above which the upload will be broken into blocks and parallelized.

Integer getNumBuffers()

Deprecated

Gets the number of buffers being used for a transfer operation.

ProgressListener getProgressListener()

Gets the Progress listener for parallel reporting

ProgressReceiver getProgressReceiver()

Deprecated

Gets the Progress receiver for parallel reporting

ParallelTransferOptions setBlockSizeLong(Long blockSize)

Sets the block size.

ParallelTransferOptions setMaxConcurrency(Integer maxConcurrency)

Sets the maximum number of parallel requests that will be issued at any given time.

ParallelTransferOptions setMaxSingleUploadSizeLong(Long maxSingleUploadSize)

If the size of the data is less than or equal to this value, it will be uploaded in a single put rather than broken up into chunks.

ParallelTransferOptions setProgressListener(ProgressListener progressListener)

Sets the ProgressReceiver.

ParallelTransferOptions setProgressReceiver(ProgressReceiver progressReceiver)

Deprecated

Sets the ProgressReceiver.

Methods inherited from java.lang.Object

Constructor Details

ParallelTransferOptions

public ParallelTransferOptions()

Creates a new ParallelTransferOptions with default parameters applied.

ParallelTransferOptions

@Deprecated
public ParallelTransferOptions(Integer blockSize, Integer maxConcurrency, ProgressReceiver progressReceiver, Integer maxSingleUploadSize)

Deprecated

Use fluent interface to set properties instead.

Creates a new ParallelTransferOptions with default parameters applied.

Parameters:

blockSize - The block size. For upload, The block size is the size of each block that will be staged. This value also determines the number of requests that need to be made. This parameter also determines the size that each buffer uses when buffering is required and consequently amount of memory consumed by such methods may be up to blockSize * numBuffers. For download to file, the block size is the size of each data chunk returned from the service. For both applications, If block size is large, upload will make fewer network calls, but each individual call will send more data and will therefore take longer.
maxConcurrency - The maximum number of parallel requests that will be issued at any given time as a part of a single parallel transfer. This value applies per api. For example, if two calls to uploadFromFile are made at the same time, and each specifies a maxConcurrency of 5, there may be up to 10 outstanding, concurrent requests, up to 5 for each of the upload operations. For buffered uploads only, the maximum number of buffers to be allocated as part of the transfer will be maxConcurrency + 1. In those cases, memory will be allocated lazily as needed. The amount of memory consumed by methods which buffer may be up to blockSize * maxConcurrency. In general, upload methods which do not accept a length parameter must perform some buffering.
progressReceiver - ProgressReceiver
maxSingleUploadSize - If the size of the data is less than or equal to this value, it will be uploaded in a single put rather than broken up into chunks. If the data is uploaded in a single shot, the block size will be ignored. Some constraints to consider are that more requests cost more, but several small or mid-sized requests may sometimes perform better. In the case of buffered upload, up to this amount of data may be buffered before any data is sent. Must be greater than 0. May be null to accept default behavior, which is the maximum value the service accepts for uploading in a single requests, which varies depending on the service.

Method Details

getBlockSize

@Deprecated
public Integer getBlockSize()

Deprecated

Gets the block size (chunk size) to transfer at a time.

Returns:

The block size.

getBlockSizeLong

public Long getBlockSizeLong()

Gets the block size (chunk size) to transfer at a time.

Returns:

The block size.

getMaxConcurrency

public Integer getMaxConcurrency()

Gets the maximum number of parallel requests that will be issued at any given time.

Returns:

The max concurrency value.

getMaxSingleUploadSize

@Deprecated
public Integer getMaxSingleUploadSize()

Deprecated

Gets the value above which the upload will be broken into blocks and parallelized.

Returns:

The threshold value.

getMaxSingleUploadSizeLong

public Long getMaxSingleUploadSizeLong()

Gets the value above which the upload will be broken into blocks and parallelized.

Returns:

The threshold value.

getNumBuffers

@Deprecated
public Integer getNumBuffers()

Deprecated

Gets the number of buffers being used for a transfer operation.

Returns:

The number of buffers.

getProgressListener

public ProgressListener getProgressListener()

Gets the Progress listener for parallel reporting

Returns:

The progress listener

getProgressReceiver

@Deprecated
public ProgressReceiver getProgressReceiver()

Deprecated

Gets the Progress receiver for parallel reporting

Returns:

The progress reporter

setBlockSizeLong

public ParallelTransferOptions setBlockSizeLong(Long blockSize)

Sets the block size. For upload, The block size is the size of each block that will be staged. This value also determines the number of requests that need to be made. This parameter also determines the size that each buffer uses when buffering is required and consequently amount of memory consumed by such methods may be up to blockSize * numBuffers. For download to file, the block size is the size of each data chunk returned from the service. For both applications, If block size is large, upload will make fewer network calls, but each individual call will send more data and will therefore take longer.

Parameters:

blockSize - The block size.

Returns:

The ParallelTransferOptions object itself.

setMaxConcurrency

public ParallelTransferOptions setMaxConcurrency(Integer maxConcurrency)

Sets the maximum number of parallel requests that will be issued at any given time.

Parameters:

maxConcurrency - The maximum number of parallel requests that will be issued at any given time as a part of a single parallel transfer. This value applies per api. For example, if two calls to uploadFromFile are made at the same time, and each specifies a maxConcurrency of 5, there may be up to 10 outstanding, concurrent requests, up to 5 for each of the upload operations. For buffered uploads only, the maximum number of buffers to be allocated as part of the transfer will be maxConcurrency + 1. In those cases, memory will be allocated lazily as needed. The amount of memory consumed by methods which buffer may be up to blockSize * maxConcurrency. In general, upload methods which do not accept a length parameter must perform some buffering.

Returns:

The ParallelTransferOptions object itself.

setMaxSingleUploadSizeLong

public ParallelTransferOptions setMaxSingleUploadSizeLong(Long maxSingleUploadSize)

If the size of the data is less than or equal to this value, it will be uploaded in a single put rather than broken up into chunks. If the data is uploaded in a single shot, the block size will be ignored. Some constraints to consider are that more requests cost more, but several small or mid-sized requests may sometimes perform better. In the case of buffered upload, up to this amount of data may be buffered before any data is sent. Must be greater than 0. May be null to accept default behavior, which is the maximum value the service accepts for uploading in a single requests, which varies depending on the service.

Parameters:

maxSingleUploadSize - The threshold value.

Returns:

The ParallelTransferOptions object itself.

setProgressListener

public ParallelTransferOptions setProgressListener(ProgressListener progressListener)

Sets the ProgressReceiver.

Parameters:

progressListener - The ProgressListener.

Returns:

The ParallelTransferOptions object itself.

setProgressReceiver

@Deprecated
public ParallelTransferOptions setProgressReceiver(ProgressReceiver progressReceiver)

Deprecated

Sets the ProgressReceiver.

Parameters:

progressReceiver - The ProgressReceiver.

Returns:

The ParallelTransferOptions object itself.

Applies to