Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bigtable): support partial results in InstanceAdminClient.Cluste… #2932

Merged
merged 5 commits into from Feb 8, 2021

Conversation

IlyaFaer
Copy link

…rs()

Towards #2914

@IlyaFaer IlyaFaer added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: bigtable Issues related to the Bigtable API. labels Sep 29, 2020
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 29, 2020
@IlyaFaer IlyaFaer marked this pull request as ready for review September 29, 2020 08:54
@tritone
Copy link
Contributor

tritone commented Oct 19, 2020

@kolea2 can you confirm that this makes sense to add from a product perspective? If so I will give it a review.

kolea2
kolea2 previously requested changes Oct 30, 2020
@@ -1034,6 +1036,11 @@ func (iac *InstanceAdminClient) Clusters(ctx context.Context, instanceID string)
StorageType: storageTypeFromProto(c.DefaultStorageType),
})
}
if len(res.FailedLocations) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add a test?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1, this would help.

Copy link
Author

Choose a reason for hiding this comment

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

Hm-m, as we're not very able to simulate "failed locations" error on real data (at least I don't know how this can be done), I think a test can be written with kind of a mock for ListClusters() method. But the mock is big, as there is an interface implementation restriction, and the interface describes a lot of methods. By the way, I see that emulator doesn't support most part of instance and cluster related methods. Should we implement them? Doesn't seem to be very hard.

@@ -1034,6 +1036,11 @@ func (iac *InstanceAdminClient) Clusters(ctx context.Context, instanceID string)
StorageType: storageTypeFromProto(c.DefaultStorageType),
})
}
if len(res.FailedLocations) > 0 {
Copy link
Author

Choose a reason for hiding this comment

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

Hm-m, as we're not very able to simulate "failed locations" error on real data (at least I don't know how this can be done), I think a test can be written with kind of a mock for ListClusters() method. But the mock is big, as there is an interface implementation restriction, and the interface describes a lot of methods. By the way, I see that emulator doesn't support most part of instance and cluster related methods. Should we implement them? Doesn't seem to be very hard.

FailedLocations: iacm.UnavailableLocations,
}
return &res, nil
}
Copy link
Author

Choose a reason for hiding this comment

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

This method will be called by Clusters which I'm changing with this PR.

iAdminClient.iClient = &instanceAdminClientMock{
Clusters: []*btapb.Cluster{&cluster1},
UnavailableLocations: []string{failedLoc},
}
Copy link
Author

Choose a reason for hiding this comment

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

Setting mock data for the test.

@tritone tritone requested review from crwilcox and a team as code owners January 23, 2021 00:46
@tritone
Copy link
Contributor

tritone commented Jan 23, 2021

Test looks fine to me. @crwilcox @kolea2 please take a look

@tritone tritone requested a review from kolea2 January 23, 2021 00:47
@crwilcox
Copy link
Contributor

crwilcox commented Feb 4, 2021

LGTM. Will give @kolea2 some time and merge tomorrow either way.

@crwilcox crwilcox merged commit 28decb5 into googleapis:master Feb 8, 2021
Copy link
Contributor

@kolea2 kolea2 left a comment

Choose a reason for hiding this comment

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

lgtm sorry for delay :) thanks for merging @crwilcox

@IlyaFaer IlyaFaer deleted the clusters_failed_location branch February 9, 2021 07:11
gcf-merge-on-green bot pushed a commit that referenced this pull request Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the Bigtable API. cla: yes This human has signed the Contributor License Agreement. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants