Skip to content

Commit

Permalink
Restore proper field name
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo committed Oct 11, 2024
1 parent a1826e4 commit cb36fa3
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class StatementClientV1
private final String clientCapabilities;
private final boolean compressionDisabled;

private final AtomicReference<State> decoderState = new AtomicReference<>(State.RUNNING);
private final AtomicReference<State> state = new AtomicReference<>(State.RUNNING);

// Data accessor for raw and encoded data
private final ResultRowsDecoder resultRowsDecoder;
Expand Down Expand Up @@ -221,25 +221,25 @@ public ZoneId getTimeZone()
@Override
public boolean isRunning()
{
return decoderState.get() == State.RUNNING;
return state.get() == State.RUNNING;
}

@Override
public boolean isClientAborted()
{
return decoderState.get() == State.CLIENT_ABORTED;
return state.get() == State.CLIENT_ABORTED;
}

@Override
public boolean isClientError()
{
return decoderState.get() == State.CLIENT_ERROR;
return state.get() == State.CLIENT_ERROR;
}

@Override
public boolean isFinished()
{
return decoderState.get() == State.FINISHED;
return state.get() == State.FINISHED;
}

@Override
Expand Down Expand Up @@ -382,7 +382,7 @@ public boolean advance()

URI nextUri = currentStatusInfo().getNextUri();
if (nextUri == null) {
decoderState.compareAndSet(State.RUNNING, State.FINISHED);
state.compareAndSet(State.RUNNING, State.FINISHED);
return false;
}

Expand All @@ -404,7 +404,7 @@ private boolean executeRequest(Request request, String taskName, OptionalLong ma
if (attempts > 0) {
Duration sinceStart = Duration.nanosSince(start);
if (sinceStart.compareTo(requestTimeoutNanos) > 0) {
decoderState.compareAndSet(State.RUNNING, State.CLIENT_ERROR);
state.compareAndSet(State.RUNNING, State.CLIENT_ERROR);
throw new RuntimeException(format("Error fetching next (attempts: %s, duration: %s)", attempts, sinceStart), cause);
}
// back-off on retry
Expand All @@ -418,7 +418,7 @@ private boolean executeRequest(Request request, String taskName, OptionalLong ma
finally {
Thread.currentThread().interrupt();
}
decoderState.compareAndSet(State.RUNNING, State.CLIENT_ERROR);
state.compareAndSet(State.RUNNING, State.CLIENT_ERROR);
throw new RuntimeException("StatementClient thread was interrupted");
}
}
Expand All @@ -441,7 +441,7 @@ private boolean executeRequest(Request request, String taskName, OptionalLong ma
}
if (response.getStatusCode() != HTTP_OK || !response.hasValue()) {
if (!shouldRetry(response.getStatusCode())) {
decoderState.compareAndSet(State.RUNNING, State.CLIENT_ERROR);
state.compareAndSet(State.RUNNING, State.CLIENT_ERROR);
throw requestFailedException(taskName, request, response);
}
continue;
Expand Down Expand Up @@ -563,7 +563,7 @@ public void cancelLeafStage()
public void close()
{
// If the query is not done, abort the query.
if (decoderState.compareAndSet(State.RUNNING, State.CLIENT_ABORTED)) {
if (state.compareAndSet(State.RUNNING, State.CLIENT_ABORTED)) {
URI uri = currentResults.get().getNextUri();
if (uri != null) {
httpDelete(uri);
Expand Down

0 comments on commit cb36fa3

Please sign in to comment.