-
Notifications
You must be signed in to change notification settings - Fork 377
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
New features in google cloud storage #5703
Comments
That seems useful, thanks. You also added an option to completely disable SSL verification, can you explain why that would be useful? Under which circumstances you do not have the certificates to verify that GCS is actually GCS? How do you protect against MITM attacks without SSL verification?
I do not follow, can you explain in more detail?
Why not just specify the last received object name in Even if one implemented this, how do you know what was the last |
|
Any reason you cannot use
Ack. You probably noticed I created specific feature requests for this and the
I see. But how do you get the |
|
I see ... I am sure you know that we reserve the right to change APIs in https://github.com/googleapis/google-cloud-cpp#api-breaking-changes I should have asked this earlier, but what is the motivation to resume listing buckets with a given page token? I am guessing you are either (1) trying to return a "page" of buckets when implementing some kind of UI that shows a subset of the buckets at a time, or (2) to checkpoint and resume listing after the application restarts. For (1): maybe you can just save the iterator and reader objects? If my guesses are wrong, maybe you can give us some more details and we can design a solution that works well for your use-case. |
Right, it is to return a page of buckets (and application could also restart). I understand that you can change API in ::internal but pageToken is exposed by the Google REST API so why it is not exposed by the SDK. |
Ack.
A few reasons:
In any case, seems like a way to save the state of the reader (token and current location) would solve your problem. I am thinking something like this, but I need to discuss it with my team: struct Page {
std::vector<std::string> bucket_names;
std::string reader_state;
};
Page BucketsPage(gcs::Client client, std::string reader_state) {
auto reader = client.ListBuckets(gcs::RestoreBucketReader(reader_state /* an empty string starts a new reader */));
std::vector<std::string> names;
for (auto& b : reader) {
if (!b || names.size() >= 100) break;
names.push_back(b->name());
}
return Page{std::move(names), std::move(reader).Checkpoint()};
}
There are boundary conditions to consider: if you create a reader with a page token, what should we do with the items already returned by the iterator? Return them again? Skip them? The latter suggests we need to save more than just the |
In my implementation, i store pageToken and the last bucket i read. |
I have broken down that last feature request to #5742. I am closing this because I think all the work is now in separate issues. Thanks for taking the time to describe the problem(s). |
What component of
google-cloud-cpp
is this feature request for?google/cloud/storage
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
My solution:
The text was updated successfully, but these errors were encountered: