# Class BigQueryStorageClient (3.29.0)

3.27.0 (latest) 3.24.0 3.23.0 3.21.0 3.20.0 3.19.1 3.18.0 3.17.3 3.16.3 3.15.3 3.14.1 3.12.0 3.11.4 3.10.3 3.9.3 3.8.0 3.6.1 3.5.2 3.4.0 3.3.1 3.2.0 3.1.0 3.0.1 2.47.0 2.45.0 2.44.1 2.43.0

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-bigquerystorage/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta1/BigQueryStorageClient.java) | [Product Reference](https://cloud.google.com/bigquery/docs/reference/storage/) |

Service Description: BigQuery storage API.

The BigQuery storage API can be used to read data stored in BigQuery.

This class provides the ability to make remote calls to the backing service through method
calls that map to API methods. Sample code to get started:

     
     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       TableReference tableReference = TableReference.newBuilder().build();
       String parent = "";
       int requestedStreams = 0;
       ReadSession response = bigQueryStorageClient.createReadSession(tableReference, parent, requestedStreams);
     }
     
     
Note: close() needs to be called on the bigQueryStorageClient object to clean up resources
such as threads. In the example above, try-with-resources is used, which automatically calls
close().

The surface of this class includes several types of Java methods for each of the API's
methods:

1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with
these names, this class includes a format method for each type of name, and additionally a parse
method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of BigQueryStorageSettings to
create(). For example:

To customize credentials:

     
     BigQueryStorageSettings bigQueryStorageSettings =
         BigQueryStorageSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     BigQueryStorageClient bigQueryStorageClient =
         BigQueryStorageClient.create(bigQueryStorageSettings);
     
     
To customize the endpoint:

     
     BigQueryStorageSettings bigQueryStorageSettings =
         BigQueryStorageSettings.newBuilder().setEndpoint(myEndpoint).build();
     BigQueryStorageClient bigQueryStorageClient =
         BigQueryStorageClient.create(bigQueryStorageSettings);
     
     
## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> BigQueryStorageClient

## Static Methods

### create()

    public static final BigQueryStorageClient create()

Constructs an instance of [BigQueryStorageClient](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient) with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(BigQueryStorageSettings settings)

    public static final BigQueryStorageClient create(BigQueryStorageSettings settings)

Constructs an instance of [BigQueryStorageClient](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient), using the given settings. The channels
are created based on the settings passed in, or defaults for any settings that are not set.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.BigQueryStorageSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(EnhancedBigQueryStorageStub stub)

    public static final BigQueryStorageClient create(EnhancedBigQueryStorageStub stub)

> [!WARNING]
> **Beta**
>
> *A restructuring of stub classes is planned, so this may break in the future*
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Constructs an instance of [BigQueryStorageClient](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient), using the given stub for making calls.
This is for advanced usage - prefer to use BigQueryStorageSettings}.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.stub.EnhancedBigQueryStorageStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient` |   |

## Constructors

### BigQueryStorageClient(BigQueryStorageSettings settings)

    protected BigQueryStorageClient(BigQueryStorageSettings settings)

Constructs an instance of [BigQueryStorageClient](https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient), using the given settings. This is
protected so that it is easy to make a subclass, but otherwise, the static factory methods
should be preferred.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.BigQueryStorageSettings` |

### BigQueryStorageClient(EnhancedBigQueryStorageStub stub)

    protected BigQueryStorageClient(EnhancedBigQueryStorageStub stub)

> [!WARNING]
> **Beta**
>
> *A restructuring of stub classes is planned, so this may break in the future*
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.stub.EnhancedBigQueryStorageStub` |

## Methods

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### batchCreateReadSessionStreams(Storage.BatchCreateReadSessionStreamsRequest request)

    public final Storage.BatchCreateReadSessionStreamsResponse batchCreateReadSessionStreams(Storage.BatchCreateReadSessionStreamsRequest request)

Creates additional streams for a ReadSession. This API can be used to dynamically adjust the
parallelism of a batch processing task upwards by adding additional workers.

Sample code:


     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       ReadSession session = ReadSession.newBuilder().build();
       int requestedStreams = 0;
       BatchCreateReadSessionStreamsRequest request = BatchCreateReadSessionStreamsRequest.newBuilder()
         .setSession(session)
         .setRequestedStreams(requestedStreams)
         .build();
       BatchCreateReadSessionStreamsResponse response = bigQueryStorageClient.batchCreateReadSessionStreams(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.BatchCreateReadSessionStreamsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.BatchCreateReadSessionStreamsResponse` |   |

### batchCreateReadSessionStreams(Storage.ReadSession session, int requestedStreams)

    public final Storage.BatchCreateReadSessionStreamsResponse batchCreateReadSessionStreams(Storage.ReadSession session, int requestedStreams)

Creates additional streams for a ReadSession. This API can be used to dynamically adjust the
parallelism of a batch processing task upwards by adding additional workers.

Sample code:


     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       ReadSession session = ReadSession.newBuilder().build();
       int requestedStreams = 0;
       BatchCreateReadSessionStreamsResponse response = bigQueryStorageClient.batchCreateReadSessionStreams(session, requestedStreams);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `session` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.ReadSession` Required. Must be a non-expired session obtained from a call to CreateReadSession. Only the name field needs to be set. |
| `requestedStreams` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` Required. Number of new streams requested. Must be positive. Number of added streams may be less than this, see CreateReadSessionRequest for more information. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.BatchCreateReadSessionStreamsResponse` |   |

### batchCreateReadSessionStreamsCallable()

    public final UnaryCallable<Storage.BatchCreateReadSessionStreamsRequest,Storage.BatchCreateReadSessionStreamsResponse> batchCreateReadSessionStreamsCallable()

Creates additional streams for a ReadSession. This API can be used to dynamically adjust the
parallelism of a batch processing task upwards by adding additional workers.

Sample code:


     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       ReadSession session = ReadSession.newBuilder().build();
       int requestedStreams = 0;
       BatchCreateReadSessionStreamsRequest request = BatchCreateReadSessionStreamsRequest.newBuilder()
         .setSession(session)
         .setRequestedStreams(requestedStreams)
         .build();
       ApiFuture<BatchCreateReadSessionStreamsResponse> future = bigQueryStorageClient.batchCreateReadSessionStreamsCallable().futureCall(request);
       // Do something
       BatchCreateReadSessionStreamsResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.BatchCreateReadSessionStreamsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.BatchCreateReadSessionStreamsResponse>` |   |

### close()

    public final void close()

### createReadSession(Storage.CreateReadSessionRequest request)

    public final Storage.ReadSession createReadSession(Storage.CreateReadSessionRequest request)

Creates a new read session. A read session divides the contents of a BigQuery table into one or
more streams, which can then be used to read data from the table. The read session also
specifies properties of the data to be read, such as a list of columns or a push-down filter
describing the rows to be returned.

A particular row can be read by at most one stream. When the caller has reached the end of
each stream in the session, then all the data in the table has been read.

Read sessions automatically expire 24 hours after they are created and do not require manual
clean-up by the caller.

Sample code:


     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       TableReference tableReference = TableReference.newBuilder().build();
       String parent = "";
       CreateReadSessionRequest request = CreateReadSessionRequest.newBuilder()
         .setTableReference(tableReference)
         .setParent(parent)
         .build();
       ReadSession response = bigQueryStorageClient.createReadSession(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.CreateReadSessionRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.ReadSession` |   |

### createReadSession(TableReferenceProto.TableReference tableReference, String parent, int requestedStreams)

    public final Storage.ReadSession createReadSession(TableReferenceProto.TableReference tableReference, String parent, int requestedStreams)

Creates a new read session. A read session divides the contents of a BigQuery table into one or
more streams, which can then be used to read data from the table. The read session also
specifies properties of the data to be read, such as a list of columns or a push-down filter
describing the rows to be returned.

A particular row can be read by at most one stream. When the caller has reached the end of
each stream in the session, then all the data in the table has been read.

Read sessions automatically expire 24 hours after they are created and do not require manual
clean-up by the caller.

Sample code:


     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       TableReference tableReference = TableReference.newBuilder().build();
       String parent = "";
       int requestedStreams = 0;
       ReadSession response = bigQueryStorageClient.createReadSession(tableReference, parent, requestedStreams);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `tableReference` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.TableReferenceProto.TableReference` Required. Reference to the table to read. |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. String of the form "projects/your-project-id" indicating the project this ReadSession is associated with. This is the project that will be billed for usage. |
| `requestedStreams` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` Optional. Initial number of streams. If unset or 0, we will provide a value of streams so as to produce reasonable throughput. Must be non-negative. The number of streams may be lower than the requested number, depending on the amount parallelism that is reasonable for the table and the maximum amount of parallelism allowed by the system. Streams must be read starting from offset 0. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.ReadSession` |   |

### createReadSessionCallable()

    public final UnaryCallable<Storage.CreateReadSessionRequest,Storage.ReadSession> createReadSessionCallable()

Creates a new read session. A read session divides the contents of a BigQuery table into one or
more streams, which can then be used to read data from the table. The read session also
specifies properties of the data to be read, such as a list of columns or a push-down filter
describing the rows to be returned.

A particular row can be read by at most one stream. When the caller has reached the end of
each stream in the session, then all the data in the table has been read.

Read sessions automatically expire 24 hours after they are created and do not require manual
clean-up by the caller.

Sample code:


     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       TableReference tableReference = TableReference.newBuilder().build();
       String parent = "";
       CreateReadSessionRequest request = CreateReadSessionRequest.newBuilder()
         .setTableReference(tableReference)
         .setParent(parent)
         .build();
       ApiFuture<ReadSession> future = bigQueryStorageClient.createReadSessionCallable().futureCall(request);
       // Do something
       ReadSession response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.CreateReadSessionRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.ReadSession>` |   |

### finalizeStream(Storage.FinalizeStreamRequest request)

    public final void finalizeStream(Storage.FinalizeStreamRequest request)

Triggers the graceful termination of a single stream in a ReadSession. This API can be used to
dynamically adjust the parallelism of a batch processing task downwards without losing data.

This API does not delete the stream -- it remains visible in the ReadSession, and any data
processed by the stream is not released to other streams. However, no additional data will be
assigned to the stream once this call completes. Callers must continue reading data on the
stream until the end of the stream is reached so that data which has already been assigned to
the stream will be processed.

This method will return an error if there are no other live streams in the Session, or if
SplitReadStream() has been called on the given Stream.

Sample code:


     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       Stream stream = Stream.newBuilder().build();
       FinalizeStreamRequest request = FinalizeStreamRequest.newBuilder()
         .setStream(stream)
         .build();
       bigQueryStorageClient.finalizeStream(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.FinalizeStreamRequest` The request object containing all of the parameters for the API call. |

### finalizeStream(Storage.Stream stream)

    public final void finalizeStream(Storage.Stream stream)

Triggers the graceful termination of a single stream in a ReadSession. This API can be used to
dynamically adjust the parallelism of a batch processing task downwards without losing data.

This API does not delete the stream -- it remains visible in the ReadSession, and any data
processed by the stream is not released to other streams. However, no additional data will be
assigned to the stream once this call completes. Callers must continue reading data on the
stream until the end of the stream is reached so that data which has already been assigned to
the stream will be processed.

This method will return an error if there are no other live streams in the Session, or if
SplitReadStream() has been called on the given Stream.

Sample code:


     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       Stream stream = Stream.newBuilder().build();
       bigQueryStorageClient.finalizeStream(stream);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stream` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.Stream` Stream to finalize. |

### finalizeStreamCallable()

    public final UnaryCallable<Storage.FinalizeStreamRequest,Empty> finalizeStreamCallable()

Triggers the graceful termination of a single stream in a ReadSession. This API can be used to
dynamically adjust the parallelism of a batch processing task downwards without losing data.

This API does not delete the stream -- it remains visible in the ReadSession, and any data
processed by the stream is not released to other streams. However, no additional data will be
assigned to the stream once this call completes. Callers must continue reading data on the
stream until the end of the stream is reached so that data which has already been assigned to
the stream will be processed.

This method will return an error if there are no other live streams in the Session, or if
SplitReadStream() has been called on the given Stream.

Sample code:


     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       Stream stream = Stream.newBuilder().build();
       FinalizeStreamRequest request = FinalizeStreamRequest.newBuilder()
         .setStream(stream)
         .build();
       ApiFuture<Void> future = bigQueryStorageClient.finalizeStreamCallable().futureCall(request);
       // Do something
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.FinalizeStreamRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html>` |   |

### getSettings()

    public final BigQueryStorageSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.BigQueryStorageSettings` |   |

### getStub()

    public EnhancedBigQueryStorageStub getStub()

> [!WARNING]
> **Beta**
>
> *A restructuring of stub classes is planned, so this may break in the future*
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.stub.EnhancedBigQueryStorageStub` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### readRowsCallable()

    public final ServerStreamingCallable<Storage.ReadRowsRequest,Storage.ReadRowsResponse> readRowsCallable()

Reads rows from the table in the format prescribed by the read session. Each response contains
one or more table rows, up to a maximum of 10 MiB per response; read requests which attempt to
read individual rows larger than this will fail.

Each request also returns a set of stream statistics reflecting the estimated total number
of rows in the read stream. This number is computed based on the total table size and the
number of active streams in the read session, and may change as other streams continue to read
data.

Sample code:


     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       StreamPosition readPosition = StreamPosition.newBuilder().build();
       ReadRowsRequest request = ReadRowsRequest.newBuilder()
         .setReadPosition(readPosition)
         .build();

       ServerStream<ReadRowsResponse> stream = bigQueryStorageClient.readRowsCallable().call(request);
       for (ReadRowsResponse response : stream) {
         // Do something when receive a response
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ServerStreamingCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.ReadRowsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.ReadRowsResponse>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### splitReadStream(Storage.SplitReadStreamRequest request)

    public final Storage.SplitReadStreamResponse splitReadStream(Storage.SplitReadStreamRequest request)

Splits a given read stream into two Streams. These streams are referred to as the primary and
the residual of the split. The original stream can still be read from in the same manner as
before. Both of the returned streams can also be read from, and the total rows return by both
child streams will be the same as the rows read from the original stream.

Moreover, the two child streams will be allocated back to back in the original Stream.
Concretely, it is guaranteed that for streams Original, Primary, and Residual, that
Original\[0-j\] = Primary\[0-j\] and Original\[j-n\] = Residual\[0-m\] once the streams have been read
to completion.

This method is guaranteed to be idempotent.

Sample code:


     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       Stream originalStream = Stream.newBuilder().build();
       SplitReadStreamRequest request = SplitReadStreamRequest.newBuilder()
         .setOriginalStream(originalStream)
         .build();
       SplitReadStreamResponse response = bigQueryStorageClient.splitReadStream(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.SplitReadStreamRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.SplitReadStreamResponse` |   |

### splitReadStream(Storage.Stream originalStream)

    public final Storage.SplitReadStreamResponse splitReadStream(Storage.Stream originalStream)

Splits a given read stream into two Streams. These streams are referred to as the primary and
the residual of the split. The original stream can still be read from in the same manner as
before. Both of the returned streams can also be read from, and the total rows return by both
child streams will be the same as the rows read from the original stream.

Moreover, the two child streams will be allocated back to back in the original Stream.
Concretely, it is guaranteed that for streams Original, Primary, and Residual, that
Original\[0-j\] = Primary\[0-j\] and Original\[j-n\] = Residual\[0-m\] once the streams have been read
to completion.

This method is guaranteed to be idempotent.

Sample code:


     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       Stream originalStream = Stream.newBuilder().build();
       SplitReadStreamResponse response = bigQueryStorageClient.splitReadStream(originalStream);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `originalStream` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.Stream` Stream to split. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.SplitReadStreamResponse` |   |

### splitReadStreamCallable()

    public final UnaryCallable<Storage.SplitReadStreamRequest,Storage.SplitReadStreamResponse> splitReadStreamCallable()

Splits a given read stream into two Streams. These streams are referred to as the primary and
the residual of the split. The original stream can still be read from in the same manner as
before. Both of the returned streams can also be read from, and the total rows return by both
child streams will be the same as the rows read from the original stream.

Moreover, the two child streams will be allocated back to back in the original Stream.
Concretely, it is guaranteed that for streams Original, Primary, and Residual, that
Original\[0-j\] = Primary\[0-j\] and Original\[j-n\] = Residual\[0-m\] once the streams have been read
to completion.

This method is guaranteed to be idempotent.

Sample code:


     try (BigQueryStorageClient bigQueryStorageClient = BigQueryStorageClient.create()) {
       Stream originalStream = Stream.newBuilder().build();
       SplitReadStreamRequest request = SplitReadStreamRequest.newBuilder()
         .setOriginalStream(originalStream)
         .build();
       ApiFuture<SplitReadStreamResponse> future = bigQueryStorageClient.splitReadStreamCallable().futureCall(request);
       // Do something
       SplitReadStreamResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.SplitReadStreamRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-bigquerystorage/latest/com.google.cloud.bigquery.storage.v1beta1.Storage.SplitReadStreamResponse>` |   |