Skip to content

Storage: Bucket metadata sample - #5800

Merged
JesseLovelace merged 10 commits into
masterfrom
locationtypesample
Aug 1, 2019
Merged

Storage: Bucket metadata sample#5800
JesseLovelace merged 10 commits into
masterfrom
locationtypesample

Conversation

@JesseLovelace

Copy link
Copy Markdown
Contributor

Bucket metadata sample and test

@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 22, 2019

@frankynfrankyn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One nit.

System.out.println("DefaultKmsKeyName: " + bucket.getDefaultKmsKeyName());
System.out.println("Id: " + bucket.getGeneratedId());
System.out.println("IndexPage: " + bucket.getIndexPage());
System.out.println("Labels: " + bucket.getLabels());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a Map. How will this be handled?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

It's a Map<String, String>, so the toString function works just fine here, would look like "{k1=v1, k2=v2}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gotcha, thanks for clarifying. Please handle the map through an iterator so the data type is surfaced.

@codecov

codecovBot commented Jul 23, 2019

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@c16d98f). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@ Coverage Diff @@## master #5800 +/- ##
=========================================
Coverage ? 46.79% Complexity ? 25663 =========================================
Files ? 2456 Lines ? 267606 Branches ? 30559 =========================================
Hits ? 125232 Misses ? 133115 Partials ? 9259

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c16d98f...dee8ee9. Read the comment docs.

labels.append("}");
labelsString = labels.toString();
}
System.out.println("Labels: " + labelsString);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you follow this pattern instead?

if (blob.getMetadata() != null) {
System.out.println("\n\n\nUser metadata:");
for (Map.Entry<String, String> userMetadata : blob.getMetadata().entrySet()) {
System.out.println(userMetadata.getKey() + "=" + userMetadata.getValue());
}
}

I misspoke, I should have pointed to this example first.

@chingor13chingor13 changed the title Bucket metadata sampleStorage: Bucket metadata sampleJul 30, 2019
@JesseLovelace
JesseLovelace merged commit 083bdf9 into masterAug 1, 2019
@Neenu1995
Neenu1995 deleted the locationtypesample branch July 6, 2022 17:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@JesseLovelace@frankyn@googlebot