GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — paging vs infinite API's - Cloud Storage, but more broadly applicable... · Issue #1798 · googleapis/google-cloud-java Closed Labels api: storageIssues related to the Cloud Storage API.priority: p2Moderately-important priority. Fix may not be included in next release.triaged for GAtype: feature request‘Nice-to-have’ improvement, new feature or different behavior or design. DescriptionIn looking at the cloud storage API's, they are really a mapping of our internal protobuf apis to a client surface rather than going with what we had hoped to be the more natural view. For example we show the following for list: String bucketName = "my_unique_bucket"; String directory = "my_directory/"; Page<Blob> blobs = storage.list(bucketName, BlobListOption.currentDirectory(), BlobListOption.prefix(directory)); Iterator<Blob> blobIterator = blobs.iterateAll(); while (blobIterator.hasNext()) { Blob blob = blobIterator.next(); // do something with the blob } In actuality the usage is more like: String bucketName = "my_unique_bucket"; String directory = "my_directory/"; Page<Blob> blobs = storage.list(bucketName, BlobListOption.currentDirectory(), BlobListOption.prefix(directory)); do { Iterator<Blob> blobIterator = blobs.iterateAll(); while (blobIterator.hasNext()) { Blob blob = blobIterator.next(); // do something with the blob } blobs = blobs.getNextPage(); } while ( blobs != null); In a sense there are cases where it makes sense to use paging, such as doing so in a web app, but there are also many cases where we should hide our complexity from our users and just provide a single blobs iterator. I don't wish to block GA with this as I don't think it makes sense, but this is something we should fix in the autogenerated libraries. Developers should be able to choose between a paged api, for webapps and the like, and a continuous api (that we can optimize behind the scenes). @anthmgoogle FYI Activity
MetadataMetadataAssigneesLabelsapi: storageIssues related to the Cloud Storage API.priority: p2Moderately-important priority. Fix may not be included in next release.triaged for GAtype: feature request‘Nice-to-have’ improvement, new feature or different behavior or design. TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |