-
Notifications
You must be signed in to change notification settings - Fork 231
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
Move list bucket methods to java-storage. #1076
Move list bucket methods to java-storage. #1076
Conversation
1a9cac7
to
22b2569
Compare
/gcbrun |
22b2569
to
8459bbc
Compare
8459bbc
to
c938fba
Compare
c938fba
to
b3c85ad
Compare
checkNotNull(storageOptions.getProjectId(), "projectId must not be null"); | ||
List<Bucket> allBuckets = new ArrayList<>(); | ||
try { | ||
Page<Bucket> buckets = |
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.
can there be more than one page or is it taken care of by the iterator?
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 iterator takes care of it. It lazily fetches another page if the current page items are exhausted. https://github.com/googleapis/java-storage/blob/main/samples/snippets/src/main/java/com/example/storage/bucket/ListBuckets.java https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.paging.Page.html#com_google_api_gax_paging_Page_iterateAll__
try { | ||
Page<Bucket> buckets = | ||
storage.list( | ||
BucketListOption.pageSize(storageOptions.getMaxListItemsPerCall()), |
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.
What is the max allowed?
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.
1000 for bucket fields without acl and 200 with acl. We use non-acl fields so it is 1000 for this use case.
/gcbrun |
/gcbrun |
No description provided.