Skip to content

feat: add support for partial success in ListBuckets for grpc#1

Open
Dhriti07 wants to merge 9 commits into
nidhiii-27:list-bucketsfrom
Dhriti07:pr-3404-merge
Open

feat: add support for partial success in ListBuckets for grpc#1
Dhriti07 wants to merge 9 commits into
nidhiii-27:list-bucketsfrom
Dhriti07:pr-3404-merge

Conversation

@Dhriti07
Copy link
Copy Markdown

PR adds support for partial list buckets for GRPC.

@Dhriti07 Dhriti07 marked this pull request as draft November 25, 2025 23:17
@Dhriti07 Dhriti07 marked this pull request as ready for review November 27, 2025 01:31
.map(
name -> {
String encoded = bucketNameCodec.encode(name);
BucketInfo.Builder builder = BucketInfo.newBuilder(encoded);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: can chain the setters of this builder

// New logic for partial success
try {
GrpcCallContext merge = Utils.merge(grpcCallContext, Retrying.newCallContext());
com.google.storage.v2.ListBucketsResponse response =
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this logic seems to be repeated multiple times including implementation of ListBucketsWithPartialSuccessPage, can we can have a helper method for this ?

page.iterateAll().forEach(allBuckets::add);

// Verify we found all expected buckets
assertThat(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

we can use other syntaxes of assertThat made specifically for assertion on collection.

Ex: assertThat(actualList).containsExactlyInAnyOrder(elem1, elem2)

throw StorageException.coalesce(e);
}
} else {
// New logic for partial success
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

remove redundant comment

throw StorageException.coalesce(e);
.apply(ListBucketsRequest.newBuilder());

final ListBucketsRequest request = builder.build();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

any reason for breaking this to new line, rather than keeping it above as ListBucketRequest

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants