Skip to content

Commit bcb47df

Browse files
authored
---
yaml --- r: 5005 b: refs/heads/master c: 0637c80 h: refs/heads/master i: 5003: edf55bf
1 parent 902a0e2 commit bcb47df

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 8d76e73c1d6fb63380c5c37094a7370feffb540b
2+
refs/heads/master: 0637c80cc23938e4bbfa6304005f975a319648b5
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: 7406918e071dd2c5677a638ae2a06e7592b6542c
55
refs/heads/pubsub-alpha: d6bbd32eed6cb48cda8d6798ee70ddd6bfc1f07d

trunk/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ public static class StreamingBuffer implements Serializable {
5353
private static final long serialVersionUID = 822027055549277843L;
5454
private final long estimatedRows;
5555
private final long estimatedBytes;
56-
private final long oldestEntryTime;
56+
private final Long oldestEntryTime;
5757

58-
StreamingBuffer(long estimatedRows, long estimatedBytes, long oldestEntryTime) {
58+
StreamingBuffer(long estimatedRows, long estimatedBytes, Long oldestEntryTime) {
5959
this.estimatedRows = estimatedRows;
6060
this.estimatedBytes = estimatedBytes;
6161
this.oldestEntryTime = oldestEntryTime;
@@ -77,9 +77,9 @@ public long estimatedBytes() {
7777

7878
/**
7979
* Returns the timestamp of the oldest entry in the streaming buffer, in milliseconds since
80-
* epoch.
80+
* epoch. Returns {@code null} if the streaming buffer is empty.
8181
*/
82-
public long oldestEntryTime() {
82+
public Long oldestEntryTime() {
8383
return oldestEntryTime;
8484
}
8585

@@ -111,9 +111,13 @@ Streamingbuffer toPb() {
111111
}
112112

113113
static StreamingBuffer fromPb(Streamingbuffer streamingBufferPb) {
114+
Long oldestEntryTime = null;
115+
if (streamingBufferPb.getOldestEntryTime() != null) {
116+
oldestEntryTime = streamingBufferPb.getOldestEntryTime().longValue();
117+
}
114118
return new StreamingBuffer(streamingBufferPb.getEstimatedRows().longValue(),
115119
streamingBufferPb.getEstimatedBytes().longValue(),
116-
streamingBufferPb.getOldestEntryTime().longValue());
120+
oldestEntryTime);
117121
}
118122
}
119123

0 commit comments

Comments
 (0)