KEMBAR78
feat: First Pass Implementation of UploadMany by sydney-munro · Pull Request #1922 · googleapis/java-storage · GitHub
Skip to content

Conversation

@sydney-munro
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the samples format.

@sydney-munro sydney-munro requested a review from a team as a code owner March 2, 2023 21:37
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: storage Issues related to the googleapis/java-storage API. labels Mar 2, 2023
@sydney-munro sydney-munro changed the title First Pass Implementation of UploadMany feat: First Pass Implementation of UploadMany Mar 2, 2023
@conventional-commit-lint-gcf
Copy link

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

Copy link
Contributor

@danielduhh danielduhh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally lgtm; just had a couple questions

public @NonNull UploadJob uploadFiles(List<Path> files, ParallelUploadConfig opts) {
List<Future<UploadResult>> uploadTasks = new ArrayList<>();
for (Path file : files) {
if (Files.isDirectory(file)) throw new IllegalStateException("Directories are not supported");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to clarify -- we plan to support Directory upload in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is that the api will just accept file paths but we will "support" directories in the samples by showing the customers how to generate that list themselves from a directory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we planning to have TransferManagerUtils be public to consumers? If so, should we consider a method like TransferManagerUtils.getFileListForDirectory(Path directory) that does it for you?

return uploadWithoutChunking();
}

private UploadResult uploadWithoutChunking() 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.

Once we support MPU, it would be great if we could determine how (single shot vs resumable vs MPU) to upload based on the object size.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I think this is the goal. also throughput based. If we are uploading super fast no sense in spending the overhead to split the work.

@sydney-munro sydney-munro merged commit 01d7de9 into feat/transfer-manager Mar 15, 2023
@sydney-munro sydney-munro deleted the transfer-impl branch March 15, 2023 19:02
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 googleapis/java-storage API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants