Skip to content
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

feat: Add Custom Part Metadata Decorator to ParallelCompositeUploadConfig #2434

Merged
merged 24 commits into from
Mar 15, 2024
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: add pool size validation
  • Loading branch information
BenWhitehead authored and sydney-munro committed Mar 15, 2024
commit 4a51be1d412444994ad739d0a856b16f70d8a354
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ private BufferAllocationStrategy() {}
*/
@BetaApi
public static BufferAllocationStrategy simple(int capacity) {
checkArgument(capacity > 0, "bufferCapacity must be > 0");
return new SimpleBufferAllocationStrategy(capacity);
}

Expand All @@ -319,6 +320,8 @@ public static BufferAllocationStrategy simple(int capacity) {
*/
@BetaApi
public static BufferAllocationStrategy fixedPool(int bufferCount, int bufferCapacity) {
checkArgument(bufferCount > 0, "bufferCount must be > 0");
checkArgument(bufferCapacity > 0, "bufferCapacity must be > 0");
return new FixedPoolBufferAllocationStrategy(bufferCount, bufferCapacity);
}

Expand Down Expand Up @@ -389,6 +392,7 @@ public static ExecutorSupplier cachedPool() {
*/
@BetaApi
public static ExecutorSupplier fixedPool(int poolSize) {
checkArgument(poolSize > 0, "poolSize must be > 0");
return new FixedSupplier(poolSize);
}

Expand Down Expand Up @@ -679,6 +683,7 @@ public abstract static class PartMetadataFieldDecorator implements Serializable
*/
@BetaApi
public static PartMetadataFieldDecorator setCustomTimeInFuture(Duration timeInFuture) {
// todo: validate non-null
sydney-munro marked this conversation as resolved.
Show resolved Hide resolved
return new CustomTimeInFuture(timeInFuture);
}

Expand Down