Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Formatting files with mvn com.coveo:fmt-maven-plugin:format
  • Loading branch information
mmladenovski committed Jan 30, 2020
commit 45970e6ba771e2f33274603280b15ae99f751be4
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@
* </code>
* </pre>
*
* <p>Note: close() needs to be called on the BigQueryReadClient object to clean up resources
* such as threads. In the example above, try-with-resources is used, which automatically calls
* close().
* <p>Note: close() needs to be called on the BigQueryReadClient object to clean up resources such
* as threads. In the example above, try-with-resources is used, which automatically calls close().
*
* <p>The surface of this class includes several types of Java methods for each of the API's
* methods:
Expand Down Expand Up @@ -107,23 +106,22 @@ public static final BigQueryReadClient create() throws IOException {
* Constructs an instance of BigQueryReadClient, using the given settings. The channels are
* created based on the settings passed in, or defaults for any settings that are not set.
*/
public static final BigQueryReadClient create(BigQueryReadSettings settings)
throws IOException {
public static final BigQueryReadClient create(BigQueryReadSettings settings) throws IOException {
return new BigQueryReadClient(settings);
}

/**
* Constructs an instance of BigQueryReadClient, using the given stub for making calls. This
* is for advanced usage - prefer to use BigQueryReadSettings}.
* Constructs an instance of BigQueryReadClient, using the given stub for making calls. This is
* for advanced usage - prefer to use BigQueryReadSettings}.
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final BigQueryReadClient create(EnhancedBigQueryReadStub stub) {
return new BigQueryReadClient(stub);
}

/**
* Constructs an instance of BigQueryReadClient, using the given settings. This is protected
* so that it is easy to make a subclass, but otherwise, the static factory methods should be
* Constructs an instance of BigQueryReadClient, 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.
*/
protected BigQueryReadClient(BigQueryReadSettings settings) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
* </code>
* </pre>
*/
public class EnhancedBigQueryReadStubSettings extends StubSettings<EnhancedBigQueryReadStubSettings> {
public class EnhancedBigQueryReadStubSettings
extends StubSettings<EnhancedBigQueryReadStubSettings> {

private final UnaryCallSettings<CreateReadSessionRequest, ReadSession> createReadSessionSettings;
private final ServerStreamingCallSettings<ReadRowsRequest, ReadRowsResponse> readRowsSettings;
Expand Down Expand Up @@ -138,7 +139,8 @@ protected EnhancedBigQueryReadStubSettings(Builder settingsBuilder) {
}

/** Builder for {@link EnhancedBigQueryReadStubSettings}. */
public static class Builder extends StubSettings.Builder<EnhancedBigQueryReadStubSettings, Builder> {
public static class Builder
extends StubSettings.Builder<EnhancedBigQueryReadStubSettings, Builder> {
private final ImmutableList<UnaryCallSettings.Builder<?, ?>> unaryMethodSettingsBuilders;

private final UnaryCallSettings.Builder<CreateReadSessionRequest, ReadSession>
Expand Down Expand Up @@ -168,8 +170,8 @@ protected Builder(ClientContext clientContext) {
splitReadStreamSettings = baseDefaults.splitReadStreamSettings();

// Per-method settings using override values for defaults.
readRowsSettings = baseDefaults.readRowsSettings()
.setResumptionStrategy(new ReadRowsResumptionStrategy());
readRowsSettings =
baseDefaults.readRowsSettings().setResumptionStrategy(new ReadRowsResumptionStrategy());

unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
@RunWith(JUnit4.class)
public class ResourceHeaderTest {

private static final String TEST_TABLE_REFERENCE = "projects/project/datasets/dataset/tables/table";
private static final String TEST_TABLE_REFERENCE =
"projects/project/datasets/dataset/tables/table";

private static final String TEST_STREAM_NAME = "streamName";

Expand All @@ -49,7 +50,8 @@ public class ResourceHeaderTest {
private static final String HEADER_NAME = "x-goog-request-params";

private static final Pattern READ_SESSION_NAME_PATTERN =
Pattern.compile(".*" + "read_session\\.table=projects/project/datasets/dataset/tables/table" + ".*");
Pattern.compile(
".*" + "read_session\\.table=projects/project/datasets/dataset/tables/table" + ".*");
private static final Pattern READ_STREAM_PATTERN =
Pattern.compile(".*" + "read_stream=streamName" + ".*");
private static final Pattern STREAM_NAME_PATTERN =
Expand Down Expand Up @@ -95,7 +97,8 @@ public static void tearDownClass() throws Exception {
@Test
public void createReadSessionTest() {
try {
client.createReadSession("parents/project", ReadSession.newBuilder().setTable(TEST_TABLE_REFERENCE).build(), 1);
client.createReadSession(
"parents/project", ReadSession.newBuilder().setTable(TEST_TABLE_REFERENCE).build(), 1);
} catch (UnimplementedException e) {
// Ignore the error: none of the methods are actually implemented.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.google.cloud.bigquery.storage.v1beta2.BigQueryReadSettings;
import com.google.cloud.bigquery.storage.v1beta2.ReadRowsRequest;
import com.google.cloud.bigquery.storage.v1beta2.ReadRowsResponse;
import com.google.cloud.bigquery.storage.v1beta2.ReadStream;
import com.google.common.collect.Queues;
import io.grpc.Status.Code;
import io.grpc.stub.StreamObserver;
Expand Down Expand Up @@ -219,9 +218,7 @@ static RpcExpectation create() {
}

static ReadRowsRequest createRequest(String streamName, long offset) {
return ReadRowsRequest.newBuilder().setReadStream(streamName)
.setOffset(offset)
.build();
return ReadRowsRequest.newBuilder().setReadStream(streamName).setOffset(offset).build();
}

static ReadRowsResponse createResponse(int numberOfRows) {
Expand Down