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: Automated backups are supported in the admin client #2472

Merged
merged 19 commits into from
Feb 5, 2025

Conversation

kevkim-codes
Copy link
Contributor

@kevkim-codes kevkim-codes commented Jan 27, 2025

Supports automated backups for the Java Bigtable client.

  • Adds AutomatedBackupPolicy subclass to the Table class.
  • Adds automated backup support to CreateTableRequest class.
  • Adds automated backup support to UpdateTableRequest class.
  • Adds unit tests for each of those classes.
  • Minor syntax formatting updates in associated files.

@kevkim-codes kevkim-codes requested review from a team as code owners January 27, 2025 22:17
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigtable Issues related to the googleapis/java-bigtable API. labels Jan 27, 2025
@kevkim-codes kevkim-codes marked this pull request as draft January 27, 2025 22:17
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Jan 28, 2025
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Feb 3, 2025
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: l Pull request size is large. labels Feb 4, 2025
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Feb 4, 2025
@kevkim-codes kevkim-codes marked this pull request as ready for review February 5, 2025 16:52
Copy link

@cindy-peng cindy-peng left a comment

Choose a reason for hiding this comment

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

LGTM with minor comments.

this.instanceId = tableName.getInstance();
this.id = tableName.getTable();
this.replicationStatesByClusterId = replicationStatesByClusterId;
this.columnFamilies = columnFamilies;
this.changeStreamRetention = changeStreamRetention;
this.deletionProtection = deletionProtection;
Table.automatedBackupPolicy = automatedBackupPolicy;

Choose a reason for hiding this comment

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

Should this be: this.automatedBackupPolicy = automatedBackupPolicy;?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So because it's a static field, I need to set it in a static way.

Here's the error I get if I try to replace Table with this:

The static field Table.automatedBackupPolicy should be accessed in a static wayJava(570425420)

@@ -136,13 +145,15 @@ public void testEquality() {
CreateTableRequest.of(TABLE_ID)
.addFamily("family-id")
.addFamily("another-family", GCRULES.maxAge(100, TimeUnit.HOURS))
// automatedbackup

Choose a reason for hiding this comment

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

Add setAutomatedBackup() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops sorry forgot to push commit, thanks for catching.

@kevkim-codes kevkim-codes merged commit 48633e6 into googleapis:main Feb 5, 2025
19 of 20 checks passed
sarthakbhutani pushed a commit to sarthakbhutani/java-bigtable that referenced this pull request Feb 13, 2025
…#2472)

* add automated backup policy model

* add automated backup policy for create table

* add updated automated backup requests

* add backup policy object to table class and retrieval methods

* changes to table.java

* revert doc change

* add unit test for policy setting on a table

* add new test for creating automated backup

* remove misc vscode settings file

* undo formatting changes in authorized views

* revert formatting

* continue revert

* redo formatting

* remove authorized views formatting

* add unit tests

* fix syntax on unit test

* fix unit test

* fix formatting
sarthakbhutani pushed a commit to sarthakbhutani/java-bigtable that referenced this pull request Feb 13, 2025
…#2472)

* add automated backup policy model

* add automated backup policy for create table

* add updated automated backup requests

* add backup policy object to table class and retrieval methods

* changes to table.java

* revert doc change

* add unit test for policy setting on a table

* add new test for creating automated backup

* remove misc vscode settings file

* undo formatting changes in authorized views

* revert formatting

* continue revert

* redo formatting

* remove authorized views formatting

* add unit tests

* fix syntax on unit test

* fix unit test

* fix formatting
sarthakbhutani pushed a commit to sarthakbhutani/java-bigtable that referenced this pull request Feb 13, 2025
…#2472)

* add automated backup policy model

* add automated backup policy for create table

* add updated automated backup requests

* add backup policy object to table class and retrieval methods

* changes to table.java

* revert doc change

* add unit test for policy setting on a table

* add new test for creating automated backup

* remove misc vscode settings file

* undo formatting changes in authorized views

* revert formatting

* continue revert

* redo formatting

* remove authorized views formatting

* add unit tests

* fix syntax on unit test

* fix unit test

* fix formatting
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 googleapis/java-bigtable API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants