-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File Shares Sync Stack Upload APIs #41664
base: main
Are you sure you want to change the base?
Conversation
API change check API changes are not detected in this pull request. |
...age/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClient.java
Outdated
Show resolved
Hide resolved
…to fileSharesSyncUpload
…to fileSharesSyncUpload
…to fileSharesSyncUpload
final long blockSize = Math.min(validatedParallelTransferOptions.getBlockSizeLong(), 4L * 1024L * 1024L); // 4 MB | ||
final int maxConcurrency = validatedParallelTransferOptions.getMaxConcurrency(); | ||
|
||
ExecutorService executor = Executors.newFixedThreadPool(maxConcurrency); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should look into designing this differently, as this will create a new thread pool per API call and will result in many, many Thread
s being created and torn down. I'd want to look into leveraging SharedExecutorService
in azure-core
as the thread pool that manages parallelization here, but that generally will have many more threads available than parallelization will be set to, so we'll need to implement some level of rate limiting.
I think we should look initially into limiting the number of calls in parallel by using a Semaphore with a number of permits equal to parallelization (and remembering to release them when that upload chunk is complete).
Description