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

In 'google-cloud-storage', Allow passing data size to Storage.create #4273

Closed
PadrePadrone opened this issue Jan 1, 2019 · 2 comments
Closed
Assignees
Labels
api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@PadrePadrone
Copy link

Thanks for stopping by to let us know something could be better!

Please include as much information as possible:

Environment details

  • OS:
  • Java version:
  • google-cloud-java version(s):

Steps to reproduce

  1. ?
  2. ?

Stacktrace

Any relevant stacktrace here.

Code snippet

Any relevant code snippet to help reproduce the issue.

External references such as API reference guides used

  • ?

Any additional information below

Following these steps will guarantee the quickest resolution possible.

Thanks!

@PadrePadrone
Copy link
Author

PadrePadrone commented Jan 1, 2019

Environment details
OS: Any
Java version: Any
google-cloud-java version(s): Current (1.56.0)

The 'create' method in the Storage interface, receives the data as a byte[] argument, and implicitly uses the array length as the data size.

We are using a pool of such arrays, all of the same size, however on every call to 'create' the actual data size is <= than the array length.
Current 'create' forces us to create a clone of the data array with the exact size. With thousands of object written, this memory used is significant.

Would be great if you could add a version of create with array length and offset:
Blob create(BlobInfo var1, byte[] var2, int offset, int len, Storage.BlobTargetOption... var3);

@JustinBeckwith JustinBeckwith added the triage me I really want to be triaged. label Jan 2, 2019
@JesseLovelace JesseLovelace added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: storage Issues related to the Cloud Storage API. and removed triage me I really want to be triaged. labels Jan 3, 2019
@andrey-qlogic andrey-qlogic self-assigned this Jan 28, 2019
@frankyn
Copy link
Member

frankyn commented Feb 7, 2019

@andrey-qlogic I'm looking over what @PadrePadrone stated in their request.

Current 'create' forces us to create a clone of the data array with the exact size. With thousands of object written, this memory used is significant.

Isn't this technically what #4273 is adding to the library, but instead hiding it from the developer?

@PadrePadrone could you comment if change #4273 will solve your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

5 participants