File tree Expand file tree Collapse file tree 7 files changed +19
-5
lines changed
google-cloud-spanner/src/main/java/com/google/cloud/spanner Expand file tree Collapse file tree 7 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -615,7 +615,7 @@ public ResultSetMetadata getMetadata() {
615615 return delegateResultSet .get ().getMetadata ();
616616 }
617617
618- public boolean initiateStreaming (StreamMessageListener streamMessageListener ) {
618+ boolean initiateStreaming (StreamMessageListener streamMessageListener ) {
619619 return StreamingUtil .initiateStreaming (delegateResultSet .get (), streamMessageListener );
620620 }
621621
Original file line number Diff line number Diff line change 1616
1717package com .google .cloud .spanner ;
1818
19+ import com .google .api .core .InternalApi ;
1920import com .google .common .base .Preconditions ;
2021import com .google .common .base .Supplier ;
2122import com .google .common .base .Suppliers ;
@@ -105,6 +106,7 @@ public ResultSetMetadata getMetadata() {
105106 }
106107
107108 @ Override
109+ @ InternalApi
108110 public boolean initiateStreaming (AsyncResultSet .StreamMessageListener streamMessageListener ) {
109111 return StreamingUtil .initiateStreaming (delegate .get (), streamMessageListener );
110112 }
Original file line number Diff line number Diff line change 1919import static com .google .cloud .spanner .SpannerExceptionFactory .newSpannerException ;
2020import static com .google .common .base .Preconditions .checkState ;
2121
22+ import com .google .api .core .InternalApi ;
2223import com .google .common .annotations .VisibleForTesting ;
2324import com .google .protobuf .Value ;
2425import com .google .spanner .v1 .PartialResultSet ;
@@ -125,6 +126,7 @@ public ResultSetMetadata getMetadata() {
125126 }
126127
127128 @ Override
129+ @ InternalApi
128130 public boolean initiateStreaming (AsyncResultSet .StreamMessageListener streamMessageListener ) {
129131 return iterator .initiateStreaming (streamMessageListener );
130132 }
Original file line number Diff line number Diff line change 2020import com .google .cloud .spanner .AbstractResultSet .CloseableIterator ;
2121import com .google .cloud .spanner .spi .v1 .SpannerRpc ;
2222import com .google .common .annotations .VisibleForTesting ;
23+ import com .google .common .base .Preconditions ;
2324import com .google .common .collect .AbstractIterator ;
2425import com .google .common .util .concurrent .Uninterruptibles ;
2526import com .google .spanner .v1 .PartialResultSet ;
@@ -68,8 +69,8 @@ protected final SpannerRpc.ResultStreamConsumer consumer() {
6869 return consumer ;
6970 }
7071
71- public void registerListener (AsyncResultSet .StreamMessageListener streamMessageListener ) {
72- this .streamMessageListener = streamMessageListener ;
72+ void registerListener (AsyncResultSet .StreamMessageListener streamMessageListener ) {
73+ this .streamMessageListener = Preconditions . checkNotNull ( streamMessageListener ) ;
7374 }
7475
7576 public void setCall (SpannerRpc .StreamingCall call , boolean withBeginTransaction ) {
Original file line number Diff line number Diff line change 2323
2424import com .google .api .client .util .BackOff ;
2525import com .google .api .client .util .ExponentialBackOff ;
26+ import com .google .api .core .InternalApi ;
2627import com .google .api .gax .grpc .GrpcStatusCode ;
2728import com .google .api .gax .retrying .RetrySettings ;
2829import com .google .api .gax .rpc .StatusCode .Code ;
@@ -223,6 +224,7 @@ public boolean isWithBeginTransaction() {
223224 }
224225
225226 @ Override
227+ @ InternalApi
226228 public boolean initiateStreaming (AsyncResultSet .StreamMessageListener streamMessageListener ) {
227229 this .streamMessageListener = streamMessageListener ;
228230 startGrpcStreaming ();
Original file line number Diff line number Diff line change 1616
1717package com .google .cloud .spanner ;
1818
19+ import com .google .api .core .InternalApi ;
20+
1921/** Streaming implementation of ResultSet that supports streaming of chunks */
2022interface StreamingResultSet extends ResultSet {
2123
2224 /**
2325 * Returns the {@link boolean} for this {@link ResultSet}. This method will be used by
24- * AsyncResultSet to initiate gRPC streaming
26+ * AsyncResultSet internally to initiate gRPC streaming. This method should not be called by the
27+ * users.
2528 */
29+ @ InternalApi
2630 boolean initiateStreaming (AsyncResultSet .StreamMessageListener streamMessageListener );
2731}
Original file line number Diff line number Diff line change 1616
1717package com .google .cloud .spanner ;
1818
19- class StreamingUtil {
19+ final class StreamingUtil {
20+
21+ private StreamingUtil () {}
22+
2023 static boolean initiateStreaming (
2124 ResultSet resultSet , AsyncResultSet .StreamMessageListener streamMessageListener ) {
2225 if (resultSet instanceof StreamingResultSet ) {
You can’t perform that action at this time.
0 commit comments