chore: fix viewConfig in AutomatedBackupPolicy (#2604) · googleapis/java-bigtable@108125b · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Commit 108125b

Browse files
authored
chore: fix viewConfig in AutomatedBackupPolicy (#2604)
1 parent 9ad66b1 commit 108125b

File tree

2 files changed

+7
-4
lines changed
  • google-cloud-bigtable/src
    • main/java/com/google/cloud/bigtable/admin/v2/models
    • test/java/com/google/cloud/bigtable/admin/v2/models

2 files changed

+7
-4
lines changed

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Table.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import com.google.api.core.InternalApi;
2020
import com.google.bigtable.admin.v2.TableName;
21+
import com.google.common.base.MoreObjects;
2122
import com.google.common.base.Objects;
2223
import com.google.common.base.Preconditions;
2324
import com.google.common.collect.ImmutableList;
@@ -128,8 +129,10 @@ public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy toProto() {
128129

129130
/** Returns policy config contents as a string. */
130131
public String viewConfig() {
131-
AutomatedBackupPolicy config = fromProto(proto);
132-
return config.proto.getAllFields().toString();
132+
return MoreObjects.toStringHelper(this)
133+
.add(proto.getClass().getName() + ".retention_period", proto.getRetentionPeriod())
134+
.add(proto.getClass().getName() + ".frequency", proto.getFrequency())
135+
.toString();
133136
}
134137
}
135138

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ public void testFromProto() {
9090
assertThat(result.isAutomatedBackupEnabled()).isTrue();
9191
assertEquals(
9292
result.getAutomatedBackupPolicy().viewConfig(),
93-
"{google.bigtable.admin.v2.Table.AutomatedBackupPolicy.retention_period=seconds: 1\n"
93+
"AutomatedBackupPolicy{com.google.bigtable.admin.v2.Table$AutomatedBackupPolicy.retention_period=seconds: 1\n"
9494
+ //
9595
"nanos: 99\n"
9696
+ //
97-
", google.bigtable.admin.v2.Table.AutomatedBackupPolicy.frequency=seconds: 1\n"
97+
", com.google.bigtable.admin.v2.Table$AutomatedBackupPolicy.frequency=seconds: 1\n"
9898
+ //
9999
"nanos: 99\n"
100100
+ //

0 commit comments

Comments
 (0)

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.