FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix StreamingBuffer to allow oldestEntryTime to be null by mziccard · Pull Request #1141 · googleapis/google-cloud-java · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public static class StreamingBuffer implements Serializable {
private static final long serialVersionUID = 822027055549277843L;
private final long estimatedRows;
private final long estimatedBytes;
private final long oldestEntryTime;
private final Long oldestEntryTime;

StreamingBuffer(long estimatedRows, long estimatedBytes, long oldestEntryTime) {
StreamingBuffer(long estimatedRows, long estimatedBytes, Long oldestEntryTime) {
this.estimatedRows = estimatedRows;
this.estimatedBytes = estimatedBytes;
this.oldestEntryTime = oldestEntryTime;
Expand All @@ -77,9 +77,9 @@ public long estimatedBytes() {

/**
* Returns the timestamp of the oldest entry in the streaming buffer, in milliseconds since
* epoch.
* epoch. Returns {@code null} if the streaming buffer is empty.
*/
public long oldestEntryTime() {
public Long oldestEntryTime() {
return oldestEntryTime;
}

Expand Down Expand Up @@ -111,9 +111,13 @@ Streamingbuffer toPb() {
}

static StreamingBuffer fromPb(Streamingbuffer streamingBufferPb) {
Long oldestEntryTime = null;
if (streamingBufferPb.getOldestEntryTime() != null) {
oldestEntryTime = streamingBufferPb.getOldestEntryTime().longValue();
}
return new StreamingBuffer(streamingBufferPb.getEstimatedRows().longValue(),
streamingBufferPb.getEstimatedBytes().longValue(),
streamingBufferPb.getOldestEntryTime().longValue());
oldestEntryTime);
}
}

Expand Down

Back | FazBrowse Home | New Git URL