-
Notifications
You must be signed in to change notification settings - Fork 378
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(spanner): add samples for MR CMEK #14674
Conversation
Here is the summary of changes. You are about to add 4 region tags.
This comment is generated by snippet-bot.
|
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 5 unresolved discussions (waiting on @panerorenn9541)
google/cloud/spanner/samples/samples.cc
line 1304 at r1 (raw file):
std::string const& src_project_id, std::string const& src_instance_id, std::string const& src_backup_id,
This is a lot of parameters for a function. Perhaps define a struct
struct BackupIdentifier {
std::string project_id;
std::string instance_id;
std::string backup_id;
};
void CopyBackupWithMRCMEK(google::cloud::spanner_admin::DatabaseAdminClient client,
BackupIdentifier const& src,
BackupIdentifier const& dst,
...
google/cloud/spanner/samples/samples.cc
line 1320 at r1 (raw file):
.get(); if (!copy_backup) throw std::move(copy_backup).status(); std::cout << "Copy Backup " << copy_backup->name() //
Are these comment sequences needed?
google/cloud/spanner/samples/samples.cc
line 1355 at r1 (raw file):
auto expire_time = TimestampAdd( google::cloud::spanner::MakeTimestamp(backup->expire_time()).value(), absl::Hours(7));
Can we use std::chrono instead of absl here?
google/cloud/spanner/samples/samples.cc
line 1614 at r1 (raw file):
void CreateBackupWithMRCMEK( google::cloud::spanner_admin::DatabaseAdminClient client, std::string const& project_id, std::string const& instance_id,
Same comment about excessive number of parameters.
google/cloud/spanner/samples/samples.cc
line 1650 at r1 (raw file):
std::cout << ", "; } }
We seem to do this several times. Perhaps factor this out into a function.
Code quote:
<< " using encryption keys ";
for (int i = 0; i < encryption_keys.size(); ++i) {
std::cout << encryption_keys[i].FullName();
if (i != encryption_keys.size() - 1) {
std::cout << ", ";
}
}
Use struct and create function to print kms keys
Use std::chrono instead of absl::hours
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 5 unresolved discussions (waiting on @scotthart)
google/cloud/spanner/samples/samples.cc
line 1304 at r1 (raw file):
Previously, scotthart (Scott Hart) wrote…
This is a lot of parameters for a function. Perhaps define a struct
struct BackupIdentifier { std::string project_id; std::string instance_id; std::string backup_id; }; void CopyBackupWithMRCMEK(google::cloud::spanner_admin::DatabaseAdminClient client, BackupIdentifier const& src, BackupIdentifier const& dst, ...
Done.
google/cloud/spanner/samples/samples.cc
line 1320 at r1 (raw file):
Previously, scotthart (Scott Hart) wrote…
Are these comment sequences needed?
The logs are there for other copy/create/restores.
google/cloud/spanner/samples/samples.cc
line 1355 at r1 (raw file):
Previously, scotthart (Scott Hart) wrote…
Can we use std::chrono instead of absl here?
Done.
google/cloud/spanner/samples/samples.cc
line 1614 at r1 (raw file):
Previously, scotthart (Scott Hart) wrote…
Same comment about excessive number of parameters.
Done.
google/cloud/spanner/samples/samples.cc
line 1650 at r1 (raw file):
Previously, scotthart (Scott Hart) wrote…
We seem to do this several times. Perhaps factor this out into a function.
Done.
/gcbrun |
/gcbrun |
Fix copy
Fix create database
Fix create backup
Fix restore
Fix keys
Fix other keys
Fix calls
/gcbrun |
Fix types
Fix type
/gcbrun |
Fix formatting
/gcbrun |
Fix formatting
/gcbrun |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14674 +/- ##
==========================================
- Coverage 93.00% 92.92% -0.09%
==========================================
Files 2351 2351
Lines 209479 209689 +210
==========================================
+ Hits 194821 194845 +24
- Misses 14658 14844 +186 ☔ View full report in Codecov by Sentry. |
Use single key in vector
/gcbrun |
/gcbrun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r9.
Reviewable status: all files reviewed (commit messages unreviewed), 5 unresolved discussions (waiting on @panerorenn9541)
Add samples for MR CMEK database creation, backup creation, copy backup, and backup restore.
This change is