@@ -65,6 +65,8 @@ public Table apply(TableInfo tableInfo) {
6565 private final Long creationTime ;
6666 private final Long expirationTime ;
6767 private final Long lastModifiedTime ;
68+ private final Long numBytes ;
69+ private final BigInteger numRows ;
6870 private final TableDefinition definition ;
6971 private final EncryptionConfiguration encryptionConfiguration ;
7072 private final Labels labels ;
@@ -92,6 +94,10 @@ public abstract static class Builder {
9294
9395 abstract Builder setLastModifiedTime (Long lastModifiedTime );
9496
97+ abstract Builder setNumBytes (Long numBytes );
98+
99+ abstract Builder setNumRows (BigInteger numRows );
100+
95101 abstract Builder setSelfLink (String selfLink );
96102
97103 /** Sets the table identity. */
@@ -134,6 +140,8 @@ static class BuilderImpl extends Builder {
134140 private Long creationTime ;
135141 private Long expirationTime ;
136142 private Long lastModifiedTime ;
143+ private Long numBytes ;
144+ private BigInteger numRows ;
137145 private TableDefinition definition ;
138146 private EncryptionConfiguration encryptionConfiguration ;
139147 private Labels labels = Labels .ZERO ;
@@ -150,6 +158,8 @@ static class BuilderImpl extends Builder {
150158 this .creationTime = tableInfo .creationTime ;
151159 this .expirationTime = tableInfo .expirationTime ;
152160 this .lastModifiedTime = tableInfo .lastModifiedTime ;
161+ this .numBytes = tableInfo .numBytes ;
162+ this .numRows = tableInfo .numRows ;
153163 this .definition = tableInfo .definition ;
154164 this .encryptionConfiguration = tableInfo .encryptionConfiguration ;
155165 this .labels = tableInfo .labels ;
@@ -167,6 +177,8 @@ static class BuilderImpl extends Builder {
167177 this .etag = tablePb .getEtag ();
168178 this .generatedId = tablePb .getId ();
169179 this .selfLink = tablePb .getSelfLink ();
180+ this .numBytes = tablePb .getNumBytes ();
181+ this .numRows = tablePb .getNumRows ();
170182 this .definition = TableDefinition .fromPb (tablePb );
171183 if (tablePb .getEncryptionConfiguration () != null ) {
172184 this .encryptionConfiguration =
@@ -217,6 +229,18 @@ Builder setLastModifiedTime(Long lastModifiedTime) {
217229 return this ;
218230 }
219231
232+ @ Override
233+ Builder setNumBytes (Long numBytes ) {
234+ this .numBytes = numBytes ;
235+ return this ;
236+ }
237+
238+ @ Override
239+ Builder setNumRows (BigInteger numRows ) {
240+ this .numRows = numRows ;
241+ return this ;
242+ }
243+
220244 @ Override
221245 Builder setSelfLink (String selfLink ) {
222246 this .selfLink = selfLink ;
@@ -263,6 +287,8 @@ public TableInfo build() {
263287 this .creationTime = builder .creationTime ;
264288 this .expirationTime = builder .expirationTime ;
265289 this .lastModifiedTime = builder .lastModifiedTime ;
290+ this .numBytes = builder .numBytes ;
291+ this .numRows = builder .numRows ;
266292 this .definition = builder .definition ;
267293 this .encryptionConfiguration = builder .encryptionConfiguration ;
268294 labels = builder .labels ;
@@ -329,6 +355,16 @@ public <T extends TableDefinition> T getDefinition() {
329355 return (T ) definition ;
330356 }
331357
358+ /** Returns the size of this table in bytes */
359+ public Long getNumBytes () {
360+ return numBytes ;
361+ }
362+
363+ /** Returns the number of rows of data in this table */
364+ public BigInteger getNumRows () {
365+ return numRows ;
366+ }
367+
332368 /**
333369 * Return a map for labels applied to the table.
334370 *
@@ -357,6 +393,8 @@ public String toString() {
357393 .add ("expirationTime" , expirationTime )
358394 .add ("creationTime" , creationTime )
359395 .add ("lastModifiedTime" , lastModifiedTime )
396+ .add ("numBytes" , numBytes )
397+ .add ("numRows" , numRows )
360398 .add ("definition" , definition )
361399 .add ("encryptionConfiguration" , encryptionConfiguration )
362400 .add ("labels" , labels )
0 commit comments