googleapis / googleapis/google-cloud-java

[java-storage] Getting both Metadata and Content with a Single request

Open
#12,636 2 comments 0 reactions 0 assignees View on GitHub
api: storage type: feature request
Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
157

Description

I might be wrong but looking at our distributed traces, it seems following code will send two GET (JSON API) requests to `stogare.googleapis.com`

```
Blob blob = storage.get(blobId);
byte[] content = blob.getContent();
```

Is there a way to get both the content and (some) metadata with a single request? There's `Storage.readAllBytes` but it does not return metadata.
We are specifically interested in `Content-Encoding`, `Content-Type` and a few other standard headers (`Cache-Control`, `Content-Length`, etc).

We have millions of small objects, and it'd be great if we can cut both the latency and the cost by half.

Contributor guide

Open the contributing guide

Research direction

Start by examining the Java Storage.get(blobId) and Storage.readAllBytes APIs and the underlying JSON API requests described in the issue. Determine whether one request can return content together with Content-Encoding, Content-Type, Cache-Control, and Content-Length. Done means the supported API behavior is documented or implemented with a single request and verified for the requested metadata.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, java
Domain
api, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.