Skip to content

Commit

Permalink
feat!: Java 8 breaking generator changes (#1222)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/d9958105-2c81-4042-8726-6edc37113f51/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

PiperOrigin-RevId: 388535346
Source-Link: googleapis/googleapis@d9eaf41
PiperOrigin-RevId: 388499329
Source-Link: googleapis/googleapis@bb0a090
  • Loading branch information
yoshi-automation committed Aug 5, 2021
1 parent 93a0eae commit ac9103c
Show file tree
Hide file tree
Showing 25 changed files with 175 additions and 1,289 deletions.
2 changes: 1 addition & 1 deletion google-cloud-bigquerystorage/clirr-ignored-differences.xml
Expand Up @@ -31,4 +31,4 @@
<className>com/google/cloud/bigquery/storage/v1beta2/JsonStreamWriter$Builder</className>
<method>com.google.cloud.bigquery.storage.v1beta2.JsonStreamWriter$Builder createDefaultStream()</method>
</difference>
</differences>
</differences>
Expand Up @@ -169,14 +169,13 @@ public BigQueryReadStubSettings.Builder getStubSettingsBuilder() {
return ((BigQueryReadStubSettings.Builder) getStubSettings());
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
Expand Down
Expand Up @@ -323,14 +323,13 @@ private static Builder initDefaults(Builder builder) {
return builder;
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
return this;
}
Expand Down
Expand Up @@ -21,7 +21,6 @@
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.RequestParamsExtractor;
import com.google.api.gax.rpc.ServerStreamingCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest;
Expand All @@ -35,7 +34,6 @@
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

Expand Down Expand Up @@ -128,41 +126,32 @@ protected GrpcBigQueryReadStub(
GrpcCallSettings.<CreateReadSessionRequest, ReadSession>newBuilder()
.setMethodDescriptor(createReadSessionMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateReadSessionRequest>() {
@Override
public Map<String, String> extract(CreateReadSessionRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"read_session.table", String.valueOf(request.getReadSession().getTable()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"read_session.table", String.valueOf(request.getReadSession().getTable()));
return params.build();
})
.build();
GrpcCallSettings<ReadRowsRequest, ReadRowsResponse> readRowsTransportSettings =
GrpcCallSettings.<ReadRowsRequest, ReadRowsResponse>newBuilder()
.setMethodDescriptor(readRowsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ReadRowsRequest>() {
@Override
public Map<String, String> extract(ReadRowsRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("read_stream", String.valueOf(request.getReadStream()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("read_stream", String.valueOf(request.getReadStream()));
return params.build();
})
.build();
GrpcCallSettings<SplitReadStreamRequest, SplitReadStreamResponse>
splitReadStreamTransportSettings =
GrpcCallSettings.<SplitReadStreamRequest, SplitReadStreamResponse>newBuilder()
.setMethodDescriptor(splitReadStreamMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<SplitReadStreamRequest>() {
@Override
public Map<String, String> extract(SplitReadStreamRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
})
.build();

Expand Down Expand Up @@ -203,7 +192,13 @@ public UnaryCallable<SplitReadStreamRequest, SplitReadStreamResponse> splitReadS

@Override
public final void close() {
shutdown();
try {
backgroundResources.close();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new IllegalStateException("Failed to close resource", e);
}
}

@Override
Expand Down
Expand Up @@ -188,14 +188,13 @@ public BigQueryStorageStubSettings.Builder getStubSettingsBuilder() {
return ((BigQueryStorageStubSettings.Builder) getStubSettings());
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
Expand Down
Expand Up @@ -375,14 +375,13 @@ private static Builder initDefaults(Builder builder) {
return builder;
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
return this;
}
Expand Down
Expand Up @@ -22,7 +22,6 @@
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.RequestParamsExtractor;
import com.google.api.gax.rpc.ServerStreamingCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.bigquery.storage.v1beta1.Storage;
Expand All @@ -32,7 +31,6 @@
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

Expand Down Expand Up @@ -173,33 +171,27 @@ protected GrpcBigQueryStorageStub(
GrpcCallSettings.<Storage.CreateReadSessionRequest, Storage.ReadSession>newBuilder()
.setMethodDescriptor(createReadSessionMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<Storage.CreateReadSessionRequest>() {
@Override
public Map<String, String> extract(Storage.CreateReadSessionRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"table_reference.dataset_id",
String.valueOf(request.getTableReference().getDatasetId()));
params.put(
"table_reference.project_id",
String.valueOf(request.getTableReference().getProjectId()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"table_reference.dataset_id",
String.valueOf(request.getTableReference().getDatasetId()));
params.put(
"table_reference.project_id",
String.valueOf(request.getTableReference().getProjectId()));
return params.build();
})
.build();
GrpcCallSettings<Storage.ReadRowsRequest, Storage.ReadRowsResponse> readRowsTransportSettings =
GrpcCallSettings.<Storage.ReadRowsRequest, Storage.ReadRowsResponse>newBuilder()
.setMethodDescriptor(readRowsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<Storage.ReadRowsRequest>() {
@Override
public Map<String, String> extract(Storage.ReadRowsRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"read_position.stream.name",
String.valueOf(request.getReadPosition().getStream().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"read_position.stream.name",
String.valueOf(request.getReadPosition().getStream().getName()));
return params.build();
})
.build();
GrpcCallSettings<
Expand All @@ -212,27 +204,20 @@ public Map<String, String> extract(Storage.ReadRowsRequest request) {
newBuilder()
.setMethodDescriptor(batchCreateReadSessionStreamsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<Storage.BatchCreateReadSessionStreamsRequest>() {
@Override
public Map<String, String> extract(
Storage.BatchCreateReadSessionStreamsRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("session.name", String.valueOf(request.getSession().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("session.name", String.valueOf(request.getSession().getName()));
return params.build();
})
.build();
GrpcCallSettings<Storage.FinalizeStreamRequest, Empty> finalizeStreamTransportSettings =
GrpcCallSettings.<Storage.FinalizeStreamRequest, Empty>newBuilder()
.setMethodDescriptor(finalizeStreamMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<Storage.FinalizeStreamRequest>() {
@Override
public Map<String, String> extract(Storage.FinalizeStreamRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("stream.name", String.valueOf(request.getStream().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("stream.name", String.valueOf(request.getStream().getName()));
return params.build();
})
.build();
GrpcCallSettings<Storage.SplitReadStreamRequest, Storage.SplitReadStreamResponse>
Expand All @@ -241,15 +226,12 @@ public Map<String, String> extract(Storage.FinalizeStreamRequest request) {
.<Storage.SplitReadStreamRequest, Storage.SplitReadStreamResponse>newBuilder()
.setMethodDescriptor(splitReadStreamMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<Storage.SplitReadStreamRequest>() {
@Override
public Map<String, String> extract(Storage.SplitReadStreamRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"original_stream.name",
String.valueOf(request.getOriginalStream().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"original_stream.name",
String.valueOf(request.getOriginalStream().getName()));
return params.build();
})
.build();

Expand Down Expand Up @@ -314,7 +296,13 @@ public UnaryCallable<Storage.FinalizeStreamRequest, Empty> finalizeStreamCallabl

@Override
public final void close() {
shutdown();
try {
backgroundResources.close();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new IllegalStateException("Failed to close resource", e);
}
}

@Override
Expand Down
Expand Up @@ -170,14 +170,13 @@ public BigQueryReadStubSettings.Builder getStubSettingsBuilder() {
return ((BigQueryReadStubSettings.Builder) getStubSettings());
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
Expand Down
Expand Up @@ -185,14 +185,13 @@ public BigQueryWriteStubSettings.Builder getStubSettingsBuilder() {
return ((BigQueryWriteStubSettings.Builder) getStubSettings());
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
Expand Down
Expand Up @@ -324,14 +324,13 @@ private static Builder initDefaults(Builder builder) {
return builder;
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
return this;
}
Expand Down
Expand Up @@ -386,14 +386,13 @@ private static Builder initDefaults(Builder builder) {
return builder;
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
return this;
}
Expand Down

0 comments on commit ac9103c

Please sign in to comment.