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

Add preload data support for putObject() API. #1156

Conversation

balamurugana
Copy link
Member

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.

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.
api/src/main/java/io/minio/MinioClient.java Show resolved Hide resolved
@@ -3807,6 +3815,25 @@ private long getAvailableSize(Object data, long expectedReadSize)
return totalBytesRead;
}

private void fillData(ByteArrayOutputStream buffer, Object data, long size) throws IOException {
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

@anjalshireesh anjalshireesh Feb 5, 2021

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)

Copy link
Member Author

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.

Copy link
Contributor

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.

@balamurugana balamurugana merged commit 2694701 into minio:master Feb 5, 2021
@balamurugana balamurugana deleted the Add-preload-data-support-for-putObject-API branch February 13, 2021 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants