-
Notifications
You must be signed in to change notification settings - Fork 21
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
Allocate direct buffers for multipart upload #559
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -58,6 +58,11 @@ public class S3StorageConfig extends AbstractConfig { | |||||
private static final String S3_MULTIPART_UPLOAD_PART_SIZE_DOC = "Size of parts in bytes to use when uploading. " | ||||||
+ "All parts but the last one will have this size. " | ||||||
+ "Valid values: between 5MiB and 2GiB"; | ||||||
|
||||||
public static final String S3_MULTIPART_UPLOAD_DIRECT_BUFFERS_CONFIG = "s3.multipart.upload.direct.buffers"; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:
Suggested change
|
||||||
public static final String S3_MULTIPART_UPLOAD_DIRECT_BUFFERS_DOC = | ||||||
"Allocate multipart upload buffers as direct buffers (off-heap)"; | ||||||
|
||||||
static final int S3_MULTIPART_UPLOAD_PART_SIZE_MIN = 5 * 1024 * 1024; // 5MiB | ||||||
static final int S3_MULTIPART_UPLOAD_PART_SIZE_MAX = Integer.MAX_VALUE; | ||||||
static final int S3_MULTIPART_UPLOAD_PART_SIZE_DEFAULT = S3_MULTIPART_UPLOAD_PART_SIZE_MIN; | ||||||
|
@@ -120,6 +125,12 @@ public class S3StorageConfig extends AbstractConfig { | |||||
null, | ||||||
ConfigDef.Importance.LOW, | ||||||
S3_PATH_STYLE_ENABLED_DOC) | ||||||
.define( | ||||||
S3_MULTIPART_UPLOAD_DIRECT_BUFFERS_CONFIG, | ||||||
ConfigDef.Type.BOOLEAN, | ||||||
false, | ||||||
ConfigDef.Importance.LOW, | ||||||
S3_MULTIPART_UPLOAD_DIRECT_BUFFERS_DOC) | ||||||
.define( | ||||||
S3_MULTIPART_UPLOAD_PART_SIZE_CONFIG, | ||||||
ConfigDef.Type.INT, | ||||||
|
@@ -261,6 +272,10 @@ public Boolean pathStyleAccessEnabled() { | |||||
return getBoolean(S3_PATH_STYLE_ENABLED_CONFIG); | ||||||
} | ||||||
|
||||||
public Boolean multipartDirectBuffers() { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:
Suggested change
|
||||||
return getBoolean(S3_MULTIPART_UPLOAD_DIRECT_BUFFERS_CONFIG); | ||||||
} | ||||||
|
||||||
public int uploadPartSize() { | ||||||
return getInt(S3_MULTIPART_UPLOAD_PART_SIZE_CONFIG); | ||||||
} | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could these tests be parametrized to have coverage for the direct allocation? |
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.
nit: