Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: googleapis/java-spanner
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8f6a74dd4e56b017612dfbea25c6b5d841daf75c
Choose a base ref
..
head repository: googleapis/java-spanner
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b70edc3570eacdba10d94b72dbbab08165308180
Choose a head ref
Original file line number Diff line number Diff line change
@@ -230,8 +230,6 @@ interface ReadyCallback {
* chunk is received from gRPC streaming call.
*/
interface StreamMessageListener {
void onStreamMessage(
PartialResultSet partialResultSet,
boolean bufferIsFull);
void onStreamMessage(PartialResultSet partialResultSet, boolean bufferIsFull);
}
}
Original file line number Diff line number Diff line change
@@ -637,9 +637,7 @@ public Struct getCurrentRowAsStruct() {
}

@Override
public void onStreamMessage(
PartialResultSet partialResultSet,
boolean bufferIsFull) {
public void onStreamMessage(PartialResultSet partialResultSet, boolean bufferIsFull) {
synchronized (monitor) {
if (produceRowsInitiated) {
return;
Original file line number Diff line number Diff line change
@@ -34,7 +34,8 @@

/** Adapts a streaming read/query call into an iterator over partial result sets. */
@VisibleForTesting
class GrpcStreamIterator extends AbstractIterator<PartialResultSet> implements CloseableIterator<PartialResultSet> {
class GrpcStreamIterator extends AbstractIterator<PartialResultSet>
implements CloseableIterator<PartialResultSet> {
private static final Logger logger = Logger.getLogger(GrpcStreamIterator.class.getName());
public static final PartialResultSet END_OF_STREAM = PartialResultSet.newBuilder().build();
private AsyncResultSet.StreamMessageListener streamMessageListener;
@@ -193,7 +194,6 @@ public boolean cancelQueryWhenClientIsClosed() {

private void onStreamMessage(PartialResultSet partialResultSet) {
Optional.ofNullable(streamMessageListener)
.ifPresent(
sl -> sl.onStreamMessage(partialResultSet, prefetchChunks >= stream.size()));
.ifPresent(sl -> sl.onStreamMessage(partialResultSet, prefetchChunks >= stream.size()));
}
}
Original file line number Diff line number Diff line change
@@ -524,8 +524,7 @@ public void testOnStreamMessageWhenResumeTokenIsPresent() {

rs.setCallback(Executors.newSingleThreadExecutor(), ignored -> CallbackResponse.DONE);
rs.onStreamMessage(
PartialResultSet.newBuilder().addValues(Value.newBuilder().build()).build(),
false);
PartialResultSet.newBuilder().addValues(Value.newBuilder().build()).build(), false);

rs.onStreamMessage(
PartialResultSet.newBuilder().setResumeToken(ByteString.copyFromUtf8("test")).build(),
@@ -546,8 +545,7 @@ public void testOnStreamMessageWhenCurrentBufferSizeReachedPrefetchChunkSize() {

rs.setCallback(Executors.newSingleThreadExecutor(), ignored -> CallbackResponse.DONE);
rs.onStreamMessage(
PartialResultSet.newBuilder().addValues(Value.newBuilder().build()).build(),
true);
PartialResultSet.newBuilder().addValues(Value.newBuilder().build()).build(), true);
Mockito.verify(mockedProvider.getExecutor(), times(2)).execute(Mockito.any());
}
}
@@ -565,8 +563,7 @@ public void testOnStreamMessageWhenAsyncResultIsCancelled() {
rs.setCallback(Executors.newSingleThreadExecutor(), ignored -> CallbackResponse.DONE);
rs.cancel();
rs.onStreamMessage(
PartialResultSet.newBuilder().addValues(Value.newBuilder().build()).build(),
false);
PartialResultSet.newBuilder().addValues(Value.newBuilder().build()).build(), false);
Mockito.verify(mockedProvider.getExecutor(), times(2)).execute(Mockito.any());
}
}