diff --git a/README.md b/README.md index 3665d2687..92bc092ab 100644 --- a/README.md +++ b/README.md @@ -31,27 +31,27 @@ If you are using Maven, add this to your pom.xml file com.google.api gax - 1.54.0 + 1.55.0 com.google.api gax-grpc - 1.54.0 + 1.55.0 ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.api:gax:1.54.0', - 'com.google.api:gax-grpc:1.54.0' +compile 'com.google.api:gax:1.55.0', + 'com.google.api:gax-grpc:1.55.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.api" % "gax" % "1.54.0" -libraryDependencies += "com.google.api" % "gax-grpc" % "1.54.0" +libraryDependencies += "com.google.api" % "gax" % "1.55.0" +libraryDependencies += "com.google.api" % "gax-grpc" % "1.55.0" ``` [//]: # ({x-version-update-end}) diff --git a/benchmark/build.gradle b/benchmark/build.gradle index e09341b3b..adb0ec38a 100644 --- a/benchmark/build.gradle +++ b/benchmark/build.gradle @@ -1,4 +1,4 @@ -project.version = "0.56.0" // {x-version-update:benchmark:current} +project.version = "0.57.0" // {x-version-update:benchmark:current} buildscript { repositories { @@ -23,8 +23,8 @@ dependencies { compile project(':gax-grpc') compile "io.grpc:grpc-netty:${libraries['version.io_grpc']}" - compile 'com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.1.28' - compile 'com.google.api.grpc:grpc-google-cloud-pubsub-v1:0.1.28' + compile 'com.google.api.grpc:grpc-google-cloud-bigtable-v2:1.11.0' + compile 'com.google.api.grpc:grpc-google-cloud-pubsub-v1:1.85.1' } // Allow command line to target specific test diff --git a/build.gradle b/build.gradle index ad5e12aef..7710a8996 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ apply plugin: 'com.github.sherter.google-java-format' apply plugin: 'io.codearte.nexus-staging' // TODO: Populate this from dependencies.properties version property (for proper Gradle-Bazel sync) -project.version = "1.54.0" // {x-version-update:gax:current} +project.version = "1.55.0" // {x-version-update:gax:current} ext { // Project names not used for release diff --git a/dependencies.properties b/dependencies.properties index a5115176d..e5e8f1d76 100644 --- a/dependencies.properties +++ b/dependencies.properties @@ -8,16 +8,16 @@ # Versions of oneself # {x-version-update-start:gax:current} -version.gax=1.54.0 +version.gax=1.55.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_grpc=1.54.0 +version.gax_grpc=1.55.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_bom=1.54.0 +version.gax_bom=1.55.0 # {x-version-update-end} # {x-version-update-start:gax-httpjson:current} -version.gax_httpjson=0.71.0 +version.gax_httpjson=0.72.0 # {x-version-update-end} # Versions for dependencies which actual artifacts differ between Bazel and Gradle. @@ -46,7 +46,7 @@ maven.com_google_errorprone_error_prone_annotations=com.google.errorprone:error_ maven.com_google_j2objc_j2objc_annotations=com.google.j2objc:j2objc-annotations:1.3 maven.com_google_auto_value_auto_value=com.google.auto.value:auto-value:1.4 maven.com_google_api_api_common=com.google.api:api-common:1.8.1 -maven.org_threeten_threetenbp=org.threeten:threetenbp:1.4.0 +maven.org_threeten_threetenbp=org.threeten:threetenbp:1.4.1 maven.com_google_api_grpc_grpc_google_iam_v1=com.google.api.grpc:grpc-google-iam-v1:0.13.0 maven.com_google_api_grpc_proto_google_iam_v1=com.google.api.grpc:proto-google-iam-v1:0.13.0 maven.com_google_http_client_google_http_client=com.google.http-client:google-http-client:1.34.2 @@ -57,7 +57,6 @@ maven.org_apache_commons_commons_lang3=org.apache.commons:commons-lang3:3.6 # Used by grpc stub maven.javax_annotation_javax_annotation_api=javax.annotation:javax.annotation-api:1.3.2 maven.com_google_guava_failureaccess=com.google.guava:failureaccess:1.0.1 -maven.com_google_android_annotations=com.google.android:annotations:4.1.1.4 maven.io_perfmark_perfmark_api=io.perfmark:perfmark-api:0.17.0 maven.io_netty_netty_handler=io.netty:netty-handler:4.1.38.Final maven.io_netty_netty_common=io.netty:netty-common:4.1.38.Final diff --git a/gax-bom/build.gradle b/gax-bom/build.gradle index 5a2edaaa7..cec11eef5 100644 --- a/gax-bom/build.gradle +++ b/gax-bom/build.gradle @@ -12,7 +12,7 @@ buildscript { archivesBaseName = "gax-bom" -project.version = "1.54.0" // {x-version-update:gax-bom:current} +project.version = "1.55.0" // {x-version-update:gax-bom:current} ext { mavenJavaDir = "$project.buildDir/publications/mavenJava" diff --git a/gax-bom/pom.xml b/gax-bom/pom.xml index a8325eabd..c76de4e10 100644 --- a/gax-bom/pom.xml +++ b/gax-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.api gax-bom - 1.54.0 + 1.55.0 pom GAX (Google Api eXtensions) for Java Google Api eXtensions for Java @@ -33,34 +33,34 @@ com.google.api gax - 1.54.0 + 1.55.0 com.google.api gax - 1.54.0 + 1.55.0 testlib com.google.api gax-grpc - 1.54.0 + 1.55.0 com.google.api gax-grpc - 1.54.0 + 1.55.0 testlib com.google.api gax-httpjson - 0.71.0 + 0.72.0 com.google.api gax-httpjson - 0.71.0 + 0.72.0 testlib diff --git a/gax-grpc/build.gradle b/gax-grpc/build.gradle index cc42cc432..75c8688b4 100644 --- a/gax-grpc/build.gradle +++ b/gax-grpc/build.gradle @@ -1,7 +1,7 @@ archivesBaseName = "gax-grpc" // TODO: Populate this from dependencies.properties version property (for proper Gradle-Bazel sync) -project.version = "1.54.0" // {x-version-update:gax-grpc:current} +project.version = "1.55.0" // {x-version-update:gax-grpc:current} dependencies { compile project(':gax'), diff --git a/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallableFactory.java b/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallableFactory.java index 5b45c9bff..e94842b27 100644 --- a/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallableFactory.java +++ b/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallableFactory.java @@ -84,12 +84,8 @@ public static UnaryCallable createBas UnaryCallSettings callSettings, ClientContext clientContext) { UnaryCallable callable = - new GrpcDirectCallable<>(grpcCallSettings.getMethodDescriptor()); - if (grpcCallSettings.getParamsExtractor() != null) { - callable = - new GrpcUnaryRequestParamCallable<>(callable, grpcCallSettings.getParamsExtractor()); - } - callable = new GrpcExceptionCallable<>(callable, callSettings.getRetryableCodes()); + GrpcRawCallableFactory.createUnaryCallable( + grpcCallSettings, callSettings.getRetryableCodes()); callable = Callables.retrying(callable, callSettings, clientContext); @@ -234,10 +230,8 @@ BidiStreamingCallable createBidiStreamingCallable( StreamingCallSettings streamingCallSettings, ClientContext clientContext) { BidiStreamingCallable callable = - new GrpcDirectBidiStreamingCallable<>(grpcCallSettings.getMethodDescriptor()); - - callable = - new GrpcExceptionBidiStreamingCallable<>(callable, ImmutableSet.of()); + GrpcRawCallableFactory.createBidiStreamingCallable( + grpcCallSettings, ImmutableSet.of()); callable = new TracedBidiCallable<>( @@ -290,15 +284,8 @@ ServerStreamingCallable createServerStreamingCallable( ServerStreamingCallSettings streamingCallSettings, ClientContext clientContext) { ServerStreamingCallable callable = - new GrpcDirectServerStreamingCallable<>(grpcCallSettings.getMethodDescriptor()); - if (grpcCallSettings.getParamsExtractor() != null) { - callable = - new GrpcServerStreamingRequestParamCallable<>( - callable, grpcCallSettings.getParamsExtractor()); - } - callable = - new GrpcExceptionServerStreamingCallable<>( - callable, streamingCallSettings.getRetryableCodes()); + GrpcRawCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings.getRetryableCodes()); if (clientContext.getStreamWatchdog() != null) { callable = Callables.watched(callable, streamingCallSettings, clientContext); @@ -332,10 +319,8 @@ ClientStreamingCallable createClientStreamingCallable( StreamingCallSettings streamingCallSettings, ClientContext clientContext) { ClientStreamingCallable callable = - new GrpcDirectClientStreamingCallable<>(grpcCallSettings.getMethodDescriptor()); - - callable = - new GrpcExceptionClientStreamingCallable<>(callable, ImmutableSet.of()); + GrpcRawCallableFactory.createClientStreamingCallable( + grpcCallSettings, ImmutableSet.of()); callable = new TracedClientStreamingCallable<>( diff --git a/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcRawCallableFactory.java b/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcRawCallableFactory.java new file mode 100644 index 000000000..248760cde --- /dev/null +++ b/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcRawCallableFactory.java @@ -0,0 +1,120 @@ +/* + * Copyright 2020 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.grpc; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.UnaryCallable; +import java.util.Set; + +/** Class with utility methods to create low level grpc-based direct callables. */ +@InternalApi("For internal use by google-cloud-java clients only") +public class GrpcRawCallableFactory { + private GrpcRawCallableFactory() {} + + /** + * Create a Unary callable object with minimal grpc-specific functionality. + * + * @param grpcCallSettings the gRPC call settings + * @param retryableCodes the {@link StatusCode.Code} that should be marked as retryable + */ + public static UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, Set retryableCodes) { + UnaryCallable callable = + new GrpcDirectCallable<>(grpcCallSettings.getMethodDescriptor()); + if (grpcCallSettings.getParamsExtractor() != null) { + callable = + new GrpcUnaryRequestParamCallable<>(callable, grpcCallSettings.getParamsExtractor()); + } + return new GrpcExceptionCallable<>(callable, retryableCodes); + } + + /** + * Create a bidirectional streaming callable object with grpc-specific functionality. Designed for + * use by generated code. + * + * @param grpcCallSettings the gRPC call settings + * @param retryableCodes the {@link StatusCode.Code} that should be marked as retryable + * @return {@link BidiStreamingCallable} callable object. + */ + @BetaApi("The surface for streaming is not stable yet and may change in the future.") + public static + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + Set retryableCodes) { + BidiStreamingCallable callable = + new GrpcDirectBidiStreamingCallable<>(grpcCallSettings.getMethodDescriptor()); + + return new GrpcExceptionBidiStreamingCallable<>(callable, retryableCodes); + } + + /** + * Create a server-streaming callable with grpc-specific functionality. Designed for use by + * generated code. + * + * @param grpcCallSettings the gRPC call settings + * @param retryableCodes the {@link StatusCode.Code} that should be marked as retryable + */ + @BetaApi("The surface for streaming is not stable yet and may change in the future.") + public static + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + Set retryableCodes) { + ServerStreamingCallable callable = + new GrpcDirectServerStreamingCallable<>(grpcCallSettings.getMethodDescriptor()); + if (grpcCallSettings.getParamsExtractor() != null) { + callable = + new GrpcServerStreamingRequestParamCallable<>( + callable, grpcCallSettings.getParamsExtractor()); + } + return new GrpcExceptionServerStreamingCallable<>(callable, retryableCodes); + } + /** + * Create a client-streaming callable object with grpc-specific functionality. Designed for use by + * generated code. + * + * @param grpcCallSettings the gRPC call settings + * @param retryableCodes the {@link StatusCode.Code} that should be marked as retryable + */ + @BetaApi("The surface for streaming is not stable yet and may change in the future.") + public static + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + Set retryableCodes) { + ClientStreamingCallable callable = + new GrpcDirectClientStreamingCallable<>(grpcCallSettings.getMethodDescriptor()); + + return new GrpcExceptionClientStreamingCallable<>(callable, retryableCodes); + } +} diff --git a/gax-httpjson/build.gradle b/gax-httpjson/build.gradle index 2bd954c27..2386a1626 100644 --- a/gax-httpjson/build.gradle +++ b/gax-httpjson/build.gradle @@ -1,7 +1,7 @@ archivesBaseName = "gax-httpjson" // TODO: Populate this from dependencies.properties version property (for proper Gradle-Bazel sync) -project.version = "0.71.0" // {x-version-update:gax-httpjson:current} +project.version = "0.72.0" // {x-version-update:gax-httpjson:current} dependencies { compile project(':gax'), diff --git a/gax/build.gradle b/gax/build.gradle index 8f531b250..a89332c35 100644 --- a/gax/build.gradle +++ b/gax/build.gradle @@ -1,7 +1,7 @@ archivesBaseName = "gax" // TODO: Populate this from dependencies.properties version property (for proper Gradle-Bazel sync) -project.version = "1.54.0" // {x-version-update:gax:current} +project.version = "1.55.0" // {x-version-update:gax:current} dependencies { compile libraries['maven.com_google_guava_guava'], diff --git a/samples/pom.xml b/samples/pom.xml index 06925b6cd..714afb3cf 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -14,13 +14,13 @@ com.google.api gax - 1.54.0 + 1.55.0 com.google.api gax-grpc - 1.54.0 + 1.55.0 com.google.auto.value diff --git a/versions.txt b/versions.txt index b4b62dfb9..0488823e1 100644 --- a/versions.txt +++ b/versions.txt @@ -1,8 +1,8 @@ # Format: # module:released-version:current-version -gax:1.54.0:1.54.0 -gax-bom:1.54.0:1.54.0 -gax-grpc:1.54.0:1.54.0 -gax-httpjson:0.71.0:0.71.0 -benchmark:0.56.0:0.56.0 +gax:1.55.0:1.55.0 +gax-bom:1.55.0:1.55.0 +gax-grpc:1.55.0:1.55.0 +gax-httpjson:0.72.0:0.72.0 +benchmark:0.57.0:0.57.0