-
Notifications
You must be signed in to change notification settings - Fork 484
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
Add preload data support for putObject() API. #1156
Add preload data support for putObject() API. #1156
Conversation
When this flag is enabled, entire part/object data is loaded into memory to enable connection retry on network failure in the middle of upload.
@@ -3807,6 +3815,25 @@ private long getAvailableSize(Object data, long expectedReadSize) | |||
return totalBytesRead; | |||
} | |||
|
|||
private void fillData(ByteArrayOutputStream buffer, Object data, long size) throws IOException { |
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.
Since this looks like a generic method to fill a given output stream, can it be moved to some utility class outside MinioClient
?
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.
It is not generic method, it is specifically designed and used to MinioClient
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.
The code is very much generic - there is nothing specific to MinioClient
in it and can definitely be used from other places if required in future.
Even if you consider it MinioClient
specific, we can still have something like MinioClientUtil
. The MinioClient.java
is too huge for comfort (5000+ lines)
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.
This is different issue, needs to be addressed in different PR.
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.
Your call. IMHO it's a good idea to start straight away, especially for new methods that are being introduced.
When this flag is enabled, entire part/object data is loaded into memory to
enable connection retry on network failure in the middle of upload.