GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Decouple Bucket from storage operations · Issue #88 · googleapis/google-cloud-java

Decouple Bucket from storage operations #88

New issue
Copy link
New issue
Copy link
Closed
Closed
Decouple Bucket from storage operations#88
Copy link
Assignees
aozarov
Labels
🚨 criticalP0 critical issue. Requires immediate fixapi: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.

Description

@jboynes
jboynes
opened on Jun 2, 2015
Issue body actions

Applications typically interact with resources in a single bucket (there are some exceptions). The Storage interface only provides ways to deal with global resources forcing the application to pass the bucket name around as an additional string. We should add a Bucket interface that supports common operations (CRUD, Copy, Move) within a single bucket.

For example:

@Resource Bucket data;

void download(String path) {
  // do something like data.reader(path);
}

Activity

  1. jboynes
    added
    api: storageIssues related to the Cloud Storage API.
    on Jun 2, 2015
  2. jgeewax commented on Jun 2, 2015

    @jgeewax
    jgeewax
    on Jun 2, 2015
    More actions

    Wouldn't this work if we just provided a getObjectInfo() method on the bucket? That way, we can pass around the bucket object, and don't need duplicate useful methods?

    class Bucket {
      ...
    
      ObjectInfo getObjectInfo(String objectName) {
        // This way I can pass around a bucket, and call getObjectInfo() on it
        // when I need the object.
        return new ObjectInfo(bucket, objectName);
      }
    
      ...
    }

    So the code you'd write is basically bucket.getObjectInfo("myfile.txt).download() or bucket.getObjectInfo("myfile.txt").delete() ?

    Which makes me ask... don't we have this already?

  3. jboynes commented on Jun 2, 2015

    @jboynes
    jboynes
    on Jun 2, 2015
    Author
    More actions

    We have BucketInfo which provides metadata about a bucket but does not allow operations on it (which makes sense for a value object). This would mean adding a Bucket interface to support operations at a Bucket level.

    #55 describes a way in which this could be implemented but I opened this to generalize the issue.

  4. jgeewax commented on Jun 2, 2015

    @jgeewax
    jgeewax
    on Jun 2, 2015
    More actions

    OK, any chance you could update the body of the issue to clarify exactly what the end result would be in a perfect world? What would the code (that I write -- as a user) ultimately look like?

  5. jboynes commented on Jun 2, 2015

    @jboynes
    jboynes
    on Jun 2, 2015
    Author
    More actions

    Also, there are cases where the application is just interested in the data and not the full BlobInfo e.g. to download the content it needs the data plus metadata pertinent to the response header e.g. Content-Type but not things like the Acl etc.

  6. jboynes commented on Jun 2, 2015

    @jboynes
    jboynes
    on Jun 2, 2015
    Author
    More actions

    Sure:

    public class DownloadServlet extends HttpServlet {
      @Resource Bucket data;
    
      public void doGet(HttpServletRequest request, HttpServletResponse response) {
        String path = request.getPathInfo();
        IOUtils.copy(data.reader(path), response.getOutputStream();
      }
    }

    Obviously there'd be some additional error handling and validation but that wouldn't affect the interface. A more serious implementation would also want more information about the object e.g. content-type, size, etag to add as response headers which would expand the interface. We could add a new one or add metadata methods to BlobReadChannel.

  7. aozarov commented on Jun 2, 2015

    @aozarov
    aozarov
    on Jun 2, 2015
    Contributor
    More actions

    I think this is part of what I am currently working on after I renamed the Bucket and Blob data models to BucketInfo and BlobInfo (as mentioned in issue #57 and described in the GCS review doc). I thought to use issue #55 for this purpose.

    The result would be functional (but not serializable) Bucket and Blob that have operations on them (such as bucket.list, bucket.getBlob,... blob.content(), blob.delete(), ..). Both Bucket and Blob would hold a reference to their associated Storage.

    Storage would be changed to return (the new functional) Bucket or Blob and accept BucketInfo or BlobInfo (or just name when content is not needed).

    Similarly Bucket would return Blob and accept BlobInfo.

    I think this would answer for issue #55 Is there more to be done for this issue?

  8. aozarov commented on Oct 8, 2015

    @aozarov
    aozarov
    on Oct 8, 2015
    Contributor
    More actions

    Functional Blob and Bucket were added in #171

  9. aozarov
    closed this as completedon Oct 8, 2015
  10. yoshi-automation
    added
    🚨 criticalP0 critical issue. Requires immediate fix
    triage meI really want to be triaged.
    on Apr 6, 2020
  11. JustinBeckwith
    assigned
    aozarov
    on Feb 1, 2021
  12. github-actions
    added 3 commits that reference this issue on Jun 23, 2022

    chore(main): release 0.2.2-SNAPSHOT (#88)

    0d119dc

    chore: update libraries-bom to 4.2.0 (googleapis#88)

    005b9da

    chore: clean up and update renovate.json (#88)

    0d49670
  13. github-actions
    added 2 commits that reference this issue on Aug 9, 2022

    chore(main): release 1.1.6-SNAPSHOT (#88)

    c302697

    chore(main): release 1.1.0 (#88)

    a37c06f
  14. github-actions
    added a commit that references this issue on Sep 15, 2022

    chore(deps): update dependency com.google.cloud:google-cloud-live-str…

    4aaebcf
  15. github-actions
    added 5 commits that reference this issue on Oct 4, 2022

    chore(main): release 0.3.6 (#99)

    fb05c8c

    chore(main): release 0.3.5 (#94)

    a2c85c4

    chore(main): release 0.5.3 (#108)

    3a04f5f

    chore(bazel): update protobuf to v3.21.7 (#88)

    7b55ba9

    chore(main): release 0.2.6 (googleapis#88)

    cb6b581
  16. meltsufin
    added a commit that references this issue on Dec 22, 2025

    chore: update repo-metadata and regenerate README from templates (#88)

    7223efd
  17. chingor13
    added a commit that references this issue on Jan 6, 2026

    build(deps): update dependency com.google.cloud:google-cloud-shared-c…

    1ae8b06
  18. chingor13
    added 2 commits that reference this issue on Jan 22, 2026

    deps: update dependency org.threeten:threetenbp to v1.4.3 (#88)

    75a7254

    chore: release 1.101.4 (#81)

    b73e70b
  19. suztomo
    added a commit that references this issue on Mar 11, 2026

    chore: update repo-metadata and regenerate README from templates (goo…

    5fe4ddf
  20. suztomo
    added a commit that references this issue on Mar 23, 2026

    build(deps): update dependency org.apache.maven.plugins:maven-javadoc…

    14c15cb
  21. benjaminp
    added a commit that references this issue on Jul 13, 2026

    chore(deps): update dependency com.google.cloud:google-cloud-shared-c…

    ede5a62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @aozarov
    aozarov

Labels

🚨 criticalP0 critical issue. Requires immediate fixapi: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue 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.