Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-bigquerystorage'
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-bigquerystorage:2.29.0'
implementation 'com.google.cloud:google-cloud-bigquerystorage:2.30.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "2.29.0"
libraryDependencies += "com.google.cloud" % "google-cloud-bigquerystorage" % "2.30.0"
```

## Authentication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,15 @@ public void close() {
this.streamWriter.close();
}

/**
* @return if a Json writer can no longer be used for writing. It is due to either the
* JsonStreamWriter is explicitly closed or the underlying connection is broken when
* connection pool is not used. Client should recreate JsonStreamWriter in this case.
*/
public boolean isDone() {
return this.streamWriter.isDone();
}

public static final class Builder {
private String streamName;
private BigQueryWriteClient client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,14 @@ public void testWriterId()
Assert.assertNotEquals(writer1.getWriterId(), writer2.getWriterId());
}

@Test
public void testIsDone() throws DescriptorValidationException, IOException, InterruptedException {
JsonStreamWriter writer1 = getTestJsonStreamWriterBuilder(TEST_STREAM, TABLE_SCHEMA).build();
Assert.assertFalse(writer1.isDone());
writer1.close();
Assert.assertTrue(writer1.isDone());
}

private AppendRowsResponse createAppendResponse(long offset) {
return AppendRowsResponse.newBuilder()
.setAppendResult(
Expand Down