Skip to content

Commit

Permalink
Add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
sakthivelmanii committed Jan 6, 2025
1 parent 4237623 commit 15a60d3
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,14 @@ public void run() {
// Non-streaming result sets do not trigger this callback, and for those result sets, we
// need to eagerly start the ProduceRowsRunnable.
synchronized (monitor) {
if (state == State.RUNNING || state == State.CONSUMING) {
if (state == State.STREAMING_INITIALIZED) {
return;
}
}
System.out.println("Initiate Streaming");
if (!initiateStreaming(AsyncResultSetImpl.this)) {
initiateProduceRows();
state = State.STREAMING_INITIALIZED;
System.out.printf("State: %s\n", state);
if (!initiateStreaming(AsyncResultSetImpl.this)) {
initiateProduceRows();
}
}
} catch (Throwable exception) {
executionException = SpannerExceptionFactory.asSpannerException(exception);
Expand All @@ -494,7 +495,6 @@ public ApiFuture<Void> setCallback(Executor exec, ReadyCallback cb) {

// Start to fetch data and buffer these.
this.result = SettableApiFuture.create();
this.state = State.STREAMING_INITIALIZED;
this.service.execute(new InitiateStreamingRunnable());
this.executor = MoreExecutors.newSequentialExecutor(Preconditions.checkNotNull(exec));
this.callback = Preconditions.checkNotNull(cb);
Expand Down

0 comments on commit 15a60d3

Please sign in to comment.