Skip to content

Commit baf973d

Browse files
authored
fix: temporally disable refreshAppend (#853)
* fix:temporily disable refreshAppend * . * . * . * Revert "." This reverts commit 9a29abe.
1 parent fc2d137 commit baf973d

File tree

3 files changed

+608
-618
lines changed

3 files changed

+608
-618
lines changed

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

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import com.google.api.gax.rpc.ResponseObserver;
3636
import com.google.api.gax.rpc.StreamController;
3737
import com.google.api.gax.rpc.TransportChannelProvider;
38+
import com.google.api.gax.rpc.UnimplementedException;
3839
import com.google.auth.oauth2.GoogleCredentials;
3940
import com.google.common.base.Preconditions;
4041
import com.google.protobuf.Int64Value;
@@ -281,27 +282,7 @@ public ApiFuture<AppendRowsResponse> append(AppendRowsRequest message) {
281282
* @throws InterruptedException
282283
*/
283284
public void refreshAppend() throws InterruptedException {
284-
appendAndRefreshAppendLock.lock();
285-
if (shutdown.get()) {
286-
LOG.warning("Cannot refresh on a already shutdown writer.");
287-
appendAndRefreshAppendLock.unlock();
288-
return;
289-
}
290-
// There could be a moment, stub is not yet initialized.
291-
if (clientStream != null) {
292-
LOG.info("Closing the stream " + streamName);
293-
clientStream.closeSend();
294-
}
295-
messagesBatch.resetAttachSchema();
296-
bidiStreamingCallable = stub.appendRowsCallable();
297-
clientStream = bidiStreamingCallable.splitCall(responseObserver);
298-
while (!clientStream.isSendReady()) {
299-
Thread.sleep(10);
300-
}
301-
Thread.sleep(this.retrySettings.getInitialRetryDelay().toMillis());
302-
// Can only unlock here since need to sleep the full 7 seconds before stream can allow appends.
303-
appendAndRefreshAppendLock.unlock();
304-
LOG.info("Write Stream " + streamName + " connection established");
285+
throw new UnimplementedException(null, GrpcStatusCode.of(Status.Code.UNIMPLEMENTED), false);
305286
}
306287

307288
private void setupAlarm() {

0 commit comments

Comments
 (0)