fix: populate table id for materialized view (#2610) · googleapis/java-bigtable@50c3fe2 · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Commit 50c3fe2

Browse files
authored
fix: populate table id for materialized view (#2610)
1 parent a873719 commit 50c3fe2

File tree

1 file changed

+7
-0
lines changed
  • google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics

1 file changed

+7
-0
lines changed

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/Util.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.google.bigtable.v2.AuthorizedViewName;
2727
import com.google.bigtable.v2.CheckAndMutateRowRequest;
2828
import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest;
29+
import com.google.bigtable.v2.MaterializedViewName;
2930
import com.google.bigtable.v2.MutateRowRequest;
3031
import com.google.bigtable.v2.MutateRowsRequest;
3132
import com.google.bigtable.v2.ReadChangeStreamRequest;
@@ -121,9 +122,11 @@ static TagValue extractStatusFromFuture(Future<?> future) {
121122
static String extractTableId(Object request) {
122123
String tableName = null;
123124
String authorizedViewName = null;
125+
String materializedViewName = null;
124126
if (request instanceof ReadRowsRequest) {
125127
tableName = ((ReadRowsRequest) request).getTableName();
126128
authorizedViewName = ((ReadRowsRequest) request).getAuthorizedViewName();
129+
materializedViewName = ((ReadRowsRequest) request).getMaterializedViewName();
127130
} else if (request instanceof MutateRowsRequest) {
128131
tableName = ((MutateRowsRequest) request).getTableName();
129132
authorizedViewName = ((MutateRowsRequest) request).getAuthorizedViewName();
@@ -133,6 +136,7 @@ static String extractTableId(Object request) {
133136
} else if (request instanceof SampleRowKeysRequest) {
134137
tableName = ((SampleRowKeysRequest) request).getTableName();
135138
authorizedViewName = ((SampleRowKeysRequest) request).getAuthorizedViewName();
139+
materializedViewName = ((SampleRowKeysRequest) request).getMaterializedViewName();
136140
} else if (request instanceof CheckAndMutateRowRequest) {
137141
tableName = ((CheckAndMutateRowRequest) request).getTableName();
138142
authorizedViewName = ((CheckAndMutateRowRequest) request).getAuthorizedViewName();
@@ -150,6 +154,9 @@ static String extractTableId(Object request) {
150154
if (authorizedViewName != null && !authorizedViewName.isEmpty()) {
151155
return AuthorizedViewName.parse(authorizedViewName).getTable();
152156
}
157+
if (materializedViewName != null && !materializedViewName.isEmpty()) {
158+
return MaterializedViewName.parse(materializedViewName).getMaterializedView();
159+
}
153160
return "<unspecified>";
154161
}
155162

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.