Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit 33a4502

Browse files
authored
fix: Remove flushAll method (#850)
* . * . * .
1 parent 6021920 commit 33a4502

File tree

3 files changed

+5
-66
lines changed

3 files changed

+5
-66
lines changed

google-cloud-bigquerystorage/clirr-ignored-differences.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,9 @@
2323
<from>com.google.protobuf.DynamicMessage convertJsonToProtoMessage(com.google.protobuf.Descriptors$Descriptor, org.json.JSONObject, boolean)</from>
2424
<to>com.google.protobuf.DynamicMessage convertJsonToProtoMessage(com.google.protobuf.Descriptors$Descriptor, org.json.JSONObject)</to>
2525
</difference>
26+
<difference>
27+
<className>com/google/cloud/bigquery/storage/v1beta2/StreamWriter</className>
28+
<differenceType>7002</differenceType>
29+
<method>void flushAll(long)</method>
30+
</difference>
2631
</differences>

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriter.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -272,37 +272,9 @@ public ApiFuture<AppendRowsResponse> append(AppendRowsRequest message) {
272272
messagesBatchLock.unlock();
273273
appendAndRefreshAppendLock.unlock();
274274
}
275-
276275
return outstandingAppend.appendResult;
277276
}
278277

279-
/**
280-
* This is the general flush method for asynchronise append operation. When you have outstanding
281-
* append requests, calling flush will make sure all outstanding append requests completed and
282-
* successful. Otherwise there will be an exception thrown.
283-
*
284-
* @throws Exception
285-
*/
286-
public void flushAll(long timeoutMillis) throws Exception {
287-
appendAndRefreshAppendLock.lock();
288-
try {
289-
writeAllOutstanding();
290-
synchronized (messagesWaiter) {
291-
messagesWaiter.waitComplete(timeoutMillis);
292-
}
293-
} finally {
294-
appendAndRefreshAppendLock.unlock();
295-
}
296-
exceptionLock.lock();
297-
try {
298-
if (streamException != null) {
299-
throw new Exception(streamException);
300-
}
301-
} finally {
302-
exceptionLock.unlock();
303-
}
304-
}
305-
306278
/**
307279
* Re-establishes a stream connection.
308280
*

google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterTest.java

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -863,44 +863,6 @@ public void testExistingClient() throws Exception {
863863
client.awaitTermination(1, TimeUnit.MINUTES);
864864
}
865865

866-
@Test
867-
public void testFlushAll() throws Exception {
868-
StreamWriter writer =
869-
getTestStreamWriterBuilder()
870-
.setBatchingSettings(
871-
StreamWriter.Builder.DEFAULT_BATCHING_SETTINGS
872-
.toBuilder()
873-
.setElementCountThreshold(2L)
874-
.setDelayThreshold(Duration.ofSeconds(100000))
875-
.build())
876-
.build();
877-
878-
testBigQueryWrite.addResponse(
879-
AppendRowsResponse.newBuilder()
880-
.setAppendResult(
881-
AppendRowsResponse.AppendResult.newBuilder().setOffset(Int64Value.of(0)).build())
882-
.build());
883-
testBigQueryWrite.addResponse(
884-
AppendRowsResponse.newBuilder()
885-
.setAppendResult(
886-
AppendRowsResponse.AppendResult.newBuilder().setOffset(Int64Value.of(2)).build())
887-
.build());
888-
testBigQueryWrite.addResponse(
889-
AppendRowsResponse.newBuilder()
890-
.setAppendResult(
891-
AppendRowsResponse.AppendResult.newBuilder().setOffset(Int64Value.of(3)).build())
892-
.build());
893-
894-
ApiFuture<AppendRowsResponse> appendFuture1 = sendTestMessage(writer, new String[] {"A"});
895-
ApiFuture<AppendRowsResponse> appendFuture2 = sendTestMessage(writer, new String[] {"B"});
896-
ApiFuture<AppendRowsResponse> appendFuture3 = sendTestMessage(writer, new String[] {"C"});
897-
assertFalse(appendFuture3.isDone());
898-
writer.flushAll(100000);
899-
assertTrue(appendFuture3.isDone());
900-
901-
writer.close();
902-
}
903-
904866
@Test
905867
public void testDatasetTraceId() throws Exception {
906868
StreamWriter writer =

0 commit comments

Comments
 (0)