Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public static class AutomatedBackupPolicy {
@InternalApi
public static AutomatedBackupPolicy fromProto(
com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy proto) {
Preconditions.checkNotNull(proto);
return new AutomatedBackupPolicy(proto);
}

Expand Down Expand Up @@ -143,7 +144,7 @@ public String viewConfig() {

private final Duration changeStreamRetention;
private final boolean deletionProtection;
private static AutomatedBackupPolicy automatedBackupPolicy;
private final AutomatedBackupPolicy automatedBackupPolicy;

@InternalApi
public static Table fromProto(@Nonnull com.google.bigtable.admin.v2.Table proto) {
Expand All @@ -170,10 +171,9 @@ public static Table fromProto(@Nonnull com.google.bigtable.admin.v2.Table proto)
proto.getChangeStreamConfig().getRetentionPeriod().getNanos());
}

AutomatedBackupPolicy automatedBackupPolicy = null;
if (proto.hasAutomatedBackupPolicy()) {
automatedBackupPolicy = AutomatedBackupPolicy.fromProto(proto.getAutomatedBackupPolicy());
} else {
automatedBackupPolicy = null;
}

return new Table(
Expand All @@ -198,7 +198,7 @@ private Table(
this.columnFamilies = columnFamilies;
this.changeStreamRetention = changeStreamRetention;
this.deletionProtection = deletionProtection;
Table.automatedBackupPolicy = automatedBackupPolicy;
this.automatedBackupPolicy = automatedBackupPolicy;
}

/** Gets the table's id. */
Expand Down Expand Up @@ -253,7 +253,7 @@ public boolean equals(Object o) {
&& Objects.equal(columnFamilies, table.columnFamilies)
&& Objects.equal(changeStreamRetention, table.changeStreamRetention)
&& Objects.equal(deletionProtection, table.deletionProtection)
&& Objects.equal(automatedBackupPolicy, Table.automatedBackupPolicy);
&& Objects.equal(automatedBackupPolicy, table.automatedBackupPolicy);
}

@Override
Expand Down
Loading