-
Notifications
You must be signed in to change notification settings - Fork 6
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
fixed chunk size #173
Merged
Merged
fixed chunk size #173
Commits on Mar 4, 2024
-
We have a fair amount of complexity (EqualSplit etc) involved in dynamically splitting files down into chunks based on available concurrency. We could be less clever and use a fixed chunk size, with a fixed buffer size to go with it. This would dovetail nicely with a sync.Pool of fixed-size buffers, and also with a configuration option to limit the total allocated RAM (implemented as a semaphore guarding how many buffers can be fetched from the sync.Pool). This commit only does consistent hashing mode; we should do buffer mode as well if we do this work.
Configuration menu - View commit details
-
Copy full SHA for 99c28d5 - Browse repository at this point
Copy the full SHA 99c28d5View commit details -
Move constants in downloads to common.go
For const and var shared between buffer and consistent-hash mode move these constants to a dedicated .go file. These are two distinct downloaders and neither should be responsible for explicitly shared elements.
Configuration menu - View commit details
-
Copy full SHA for 9862405 - Browse repository at this point
Copy the full SHA 9862405View commit details -
Wire up --chunk-size to cli options
Wire up the --chunk-size option and deprecate --minimum-chunk-size.
Configuration menu - View commit details
-
Copy full SHA for 6f9c682 - Browse repository at this point
Copy the full SHA 6f9c682View commit details -
The concurrency calculation is no longer used in consistent-hashing. Remove it.
Configuration menu - View commit details
-
Copy full SHA for d700109 - Browse repository at this point
Copy the full SHA d700109View commit details -
Update Buffer to use ChunkSize
Update Buffer downloader to use ChunkSize instead of MinChunkSize. Options have been modified to only contain ChunkSize now as the root and multifile commands no longer reference MinChunkSize. This change is in support of moving towards simplifying the chunksize logic. Additionally this will make reuse of buffers significantly easier as the next phase.
Configuration menu - View commit details
-
Copy full SHA for efe1ac0 - Browse repository at this point
Copy the full SHA efe1ac0View commit details
Commits on Mar 5, 2024
-
If chunkSize doesn't divide contentSize evenly, and chunkSize < 0.5*contentSize, we try to download a chunk bigger than chunkSize. This should not be possible.
Configuration menu - View commit details
-
Copy full SHA for 31bc26d - Browse repository at this point
Copy the full SHA 31bc26dView commit details -
Every chunk except the last is now the same chunkSize, which is the intention of the code. We no longer dynamically change chunk size. Also, simplify the consistent hashing code to be more similar to buffer mode, and remove the dead EqualSplit code.
Configuration menu - View commit details
-
Copy full SHA for 7ec1a9b - Browse repository at this point
Copy the full SHA 7ec1a9bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 870dcd8 - Browse repository at this point
Copy the full SHA 870dcd8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6517274 - Browse repository at this point
Copy the full SHA 6517274View commit details -
Configuration menu - View commit details
-
Copy full SHA for 401e975 - Browse repository at this point
Copy the full SHA 401e975View commit details -
Configuration menu - View commit details
-
Copy full SHA for fae7259 - Browse repository at this point
Copy the full SHA fae7259View commit details -
Aliases in Cobra and Viper are relatively complex and viper.RegisterAlias does not do what would be expected as ENV handling is a very special case. This commit fixes up the handling of aliases specifically for chunk size and minimuim chunk size. * CLI Option Set * NEW ENV VAR * Deprecated ENV Var * Default Value For ChunkSize and MinimumChunkSize we now explicitly disallow setting both --chunk-size and --minimum-chunk-size as CLI options. If PGET_CHUNK_SIZE is set, we utilize that value except if the cli option(s) are set. If PGET_MINIMUM_CHUNK_SIZE is set * If PGET_CHUNK_SIZE is set to a non-default value a warning is emitted, and PGET_CHUNK_SIZE is used.. * If PGET_CHUNK_SIZE is the default value, PGET_MINIMUM_CHUNK_SIZE is set as PGET_CHUNK_SIZE and a deprecation warning is emitted. Additionally, viper calls now all reference config.OptChunkSize
Configuration menu - View commit details
-
Copy full SHA for e71b6b2 - Browse repository at this point
Copy the full SHA e71b6b2View commit details
Commits on Mar 6, 2024
-
Simplify conditional. Also, if both PGET_MINIMUM_CHUNK_SIZE and PGET_CHUNK_SIZE are set to the same value, don't emit a warning.
Configuration menu - View commit details
-
Copy full SHA for a41a4c4 - Browse repository at this point
Copy the full SHA a41a4c4View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.