diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 5f0e5d39..3f7432a5 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: - digest: sha256:a9b83a276c82987d284b733713fe86a3c8a2cc457933767eeb2688b882e54c6a - image: gcr.io/repo-automation-bots/owlbot-java:latest \ No newline at end of file + image: gcr.io/repo-automation-bots/owlbot-java:latest + digest: sha256:12cbdc4f137152a1a8b83f50ebc1a4098be0d3baff78b46efaec306f7cfafd13 diff --git a/.github/release-please.yml b/.github/release-please.yml index 8ca7f9ca..7bf58076 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,3 +1,8 @@ bumpMinorPreMajor: true handleGHRelease: true releaseType: java-yoshi +branches: + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-yoshi + branch: java7 diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index e100454f..84b918e8 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -1,49 +1,45 @@ - -# Whether or not rebase-merging is enabled on this repository. -# Defaults to `true` rebaseMergeAllowed: false - -# Whether or not squash-merging is enabled on this repository. -# Defaults to `true` squashMergeAllowed: true - -# Whether or not PRs are merged with a merge commit on this repository. -# Defaults to `false` mergeCommitAllowed: false - -# Rules for master branch protection branchProtectionRules: -# Identifies the protection rule pattern. Name of the branch to be protected. -# Defaults to `master` -- pattern: master - # Can admins overwrite branch protection. - # Defaults to `true` - isAdminEnforced: true - # Number of approving reviews required to update matching branches. - # Defaults to `1` - requiredApprovingReviewCount: 1 - # Are reviews from code owners required to update matching branches. - # Defaults to `false` - requiresCodeOwnerReviews: true - # Require up to date branches - requiresStrictStatusChecks: false - # List of required status check contexts that must pass for commits to be accepted to matching branches. - requiredStatusCheckContexts: - - "dependencies (8)" - - "dependencies (11)" - - "linkage-monitor" - - "lint" - - "clirr" - - "units (7)" - - "units (8)" - - "units (11)" - - "Kokoro - Test: Integration" - - "cla/google" -# List of explicit permissions to add (additive only) + - pattern: master + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - linkage-monitor + - lint + - clirr + - units (7) + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - OwlBot Post Processor + - pattern: java7 + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - linkage-monitor + - lint + - clirr + - units (7) + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - OwlBot Post Processor permissionRules: -- team: yoshi-admins - permission: admin -- team: yoshi-java-admins - permission: admin -- team: yoshi-java - permission: push + - team: yoshi-admins + permission: admin + - team: yoshi-java-admins + permission: admin + - team: yoshi-java + permission: push diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0195b32f..65ae6ecd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [7, 8, 11] + java: [8, 11] steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 94dc6527..ed522b67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## [0.2.0](https://www.github.com/googleapis/java-datastream/compare/v0.1.0...v0.2.0) (2021-08-09) + + +### ⚠ BREAKING CHANGES + +* release gapic-generator-java v2.0.0 (#29) + +### Features + +* release gapic-generator-java v2.0.0 ([#29](https://www.github.com/googleapis/java-datastream/issues/29)) ([65f3189](https://www.github.com/googleapis/java-datastream/commit/65f31891c6058eee2c7c3da3f352667bb552f257)) + + +### Bug Fixes + +* owlbot post-processor should generate README ([#1154](https://www.github.com/googleapis/java-datastream/issues/1154)) ([#15](https://www.github.com/googleapis/java-datastream/issues/15)) ([0a9a147](https://www.github.com/googleapis/java-datastream/commit/0a9a147dff0a36d37ef645c935cfef168ea7c6ac)), closes [#1146](https://www.github.com/googleapis/java-datastream/issues/1146) [#1147](https://www.github.com/googleapis/java-datastream/issues/1147) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2 ([#30](https://www.github.com/googleapis/java-datastream/issues/30)) ([c5974c7](https://www.github.com/googleapis/java-datastream/commit/c5974c75486e8ed2381db8a3b6973c2f2e87e172)) + ## 0.1.0 (2021-07-08) diff --git a/README.md b/README.md index 129ecc15..4252fd8f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Datastream Client for Java +# Google Datastream Client for Java Java idiomatic client for [Datastream][product-docs]. @@ -11,39 +11,48 @@ Java idiomatic client for [Datastream][product-docs]. > Note: This client is a work-in-progress, and may occasionally > make backwards-incompatible changes. + ## Quickstart If you are using Maven, add this to your pom.xml file: + ```xml com.google.cloud google-cloud-datastream - 0.0.0 + 0.1.0 + ``` If you are using Gradle without BOM, add this to your dependencies + ```Groovy -compile 'com.google.cloud:google-cloud-datastream:0.0.0' +compile 'com.google.cloud:google-cloud-datastream:0.1.0' ``` If you are using SBT, add this to your dependencies + ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-datastream" % "0.0.0" +libraryDependencies += "com.google.cloud" % "google-cloud-datastream" % "0.1.0" ``` ## Authentication See the [Authentication][authentication] section in the base directory's README. +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Datastream APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Datastream API calls. + ## Getting Started ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Datastream [API enabled][enable-api]. -You will need to [enable billing][enable-billing] to use Datastream. +You will need to [enable billing][enable-billing] to use Google Datastream. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -58,10 +67,14 @@ to add `google-cloud-datastream` as a dependency in your code. [Datastream][product-docs] is a serverless and easy-to-use change data capture (CDC) and replication service. It allows you to synchronize data across heterogeneous databases and applications reliably, and with minimal latency and downtime. - See the [Datastream client library docs][javadocs] to learn how to use this Datastream Client Library. + + + + + ## Troubleshooting To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. @@ -70,10 +83,50 @@ To get help, follow the instructions in the [shared Troubleshooting document][tr Datastream uses gRPC for the transport layer. -## Java Versions +## Supported Java Versions Java 7 or above is required for using this client. +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + ## Versioning @@ -83,6 +136,7 @@ This library follows [Semantic Versioning](http://semver.org/). It is currently in major version zero (``0.y.z``), which means that anything may change at any time and the public API should not be considered stable. + ## Contributing @@ -94,6 +148,7 @@ Please note that this project is released with a Contributor Code of Conduct. By this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. + ## License Apache 2.0 - See [LICENSE][license] for more information. @@ -110,7 +165,7 @@ Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] Java is a registered trademark of Oracle and/or its affiliates. -[product-docs]: https://cloud.google.com/datastream/docs/ +[product-docs]: https://cloud.google.com/datastream/docs [javadocs]: https://googleapis.dev/java/google-cloud-datastream/latest/index.html [kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-datastream/java7.svg [kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-datastream/java7.html @@ -122,10 +177,13 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-datastream/java8-win.html [kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-datastream/java11.svg [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-datastream/java11.html -[stability-image]: https://img.shields.io/badge/stability-beta-yellow +[stability-image]: https://img.shields.io/badge/stability-alpha-orange [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-datastream.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-datastream&core=gav [authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy [developer-console]: https://console.developers.google.com/ [create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects [cloud-sdk]: https://cloud.google.com/sdk/ @@ -136,4 +194,10 @@ Java is a registered trademark of Oracle and/or its affiliates. [enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=datastream.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png \ No newline at end of file +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/google-cloud-datastream-bom/pom.xml b/google-cloud-datastream-bom/pom.xml index 1256e6e4..5bf3e855 100644 --- a/google-cloud-datastream-bom/pom.xml +++ b/google-cloud-datastream-bom/pom.xml @@ -3,12 +3,12 @@ 4.0.0 com.google.cloud google-cloud-datastream-bom - 0.1.0 + 0.2.0 pom com.google.cloud google-cloud-shared-config - 0.12.0 + 1.0.0 Google Datastream BOM @@ -56,17 +56,17 @@ com.google.cloud google-cloud-datastream - 0.1.0 + 0.2.0 com.google.api.grpc grpc-google-cloud-datastream-v1alpha1 - 0.1.0 + 0.2.0 com.google.api.grpc proto-google-cloud-datastream-v1alpha1 - 0.1.0 + 0.2.0 diff --git a/google-cloud-datastream/pom.xml b/google-cloud-datastream/pom.xml index 2c9d5d48..c0d36203 100644 --- a/google-cloud-datastream/pom.xml +++ b/google-cloud-datastream/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-datastream - 0.1.0 + 0.2.0 jar Google Datastream https://github.com/googleapis/java-datastream @@ -11,7 +11,7 @@ com.google.cloud google-cloud-datastream-parent - 0.1.0 + 0.2.0 google-cloud-datastream diff --git a/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/DatastreamClient.java b/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/DatastreamClient.java index c8048f8d..4babda3a 100644 --- a/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/DatastreamClient.java +++ b/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/DatastreamClient.java @@ -16,7 +16,6 @@ package com.google.cloud.datastream.v1alpha1; -import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; @@ -2802,12 +2801,7 @@ public static ApiFuture createAsync( ListConnectionProfilesPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { - @Override - public ListConnectionProfilesPagedResponse apply(ListConnectionProfilesPage input) { - return new ListConnectionProfilesPagedResponse(input); - } - }, + input -> new ListConnectionProfilesPagedResponse(input), MoreExecutors.directExecutor()); } @@ -2892,14 +2886,7 @@ public static ApiFuture createAsync( ApiFuture futurePage = ListStreamsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( - futurePage, - new ApiFunction() { - @Override - public ListStreamsPagedResponse apply(ListStreamsPage input) { - return new ListStreamsPagedResponse(input); - } - }, - MoreExecutors.directExecutor()); + futurePage, input -> new ListStreamsPagedResponse(input), MoreExecutors.directExecutor()); } private ListStreamsPagedResponse(ListStreamsPage page) { @@ -2973,12 +2960,7 @@ public static ApiFuture createAsync( FetchStaticIpsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { - @Override - public FetchStaticIpsPagedResponse apply(FetchStaticIpsPage input) { - return new FetchStaticIpsPagedResponse(input); - } - }, + input -> new FetchStaticIpsPagedResponse(input), MoreExecutors.directExecutor()); } @@ -3056,12 +3038,7 @@ public static ApiFuture createAsync( ListPrivateConnectionsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { - @Override - public ListPrivateConnectionsPagedResponse apply(ListPrivateConnectionsPage input) { - return new ListPrivateConnectionsPagedResponse(input); - } - }, + input -> new ListPrivateConnectionsPagedResponse(input), MoreExecutors.directExecutor()); } @@ -3146,14 +3123,7 @@ public static ApiFuture createAsync( ApiFuture futurePage = ListRoutesPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( - futurePage, - new ApiFunction() { - @Override - public ListRoutesPagedResponse apply(ListRoutesPage input) { - return new ListRoutesPagedResponse(input); - } - }, - MoreExecutors.directExecutor()); + futurePage, input -> new ListRoutesPagedResponse(input), MoreExecutors.directExecutor()); } private ListRoutesPagedResponse(ListRoutesPage page) { diff --git a/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/DatastreamSettings.java b/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/DatastreamSettings.java index ef9d9a9a..17b71807 100644 --- a/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/DatastreamSettings.java +++ b/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/DatastreamSettings.java @@ -351,14 +351,13 @@ public DatastreamStubSettings.Builder getStubSettingsBuilder() { return ((DatastreamStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods( getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; diff --git a/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/stub/DatastreamStubSettings.java b/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/stub/DatastreamStubSettings.java index 920fb722..54f0b03f 100644 --- a/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/stub/DatastreamStubSettings.java +++ b/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/stub/DatastreamStubSettings.java @@ -1435,14 +1435,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. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } diff --git a/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/stub/GrpcDatastreamStub.java b/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/stub/GrpcDatastreamStub.java index 62687745..4e95111f 100644 --- a/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/stub/GrpcDatastreamStub.java +++ b/google-cloud-datastream/src/main/java/com/google/cloud/datastream/v1alpha1/stub/GrpcDatastreamStub.java @@ -29,7 +29,6 @@ import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.datastream.v1alpha1.ConnectionProfile; import com.google.cloud.datastream.v1alpha1.CreateConnectionProfileRequest; @@ -71,7 +70,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; @@ -412,13 +410,10 @@ protected GrpcDatastreamStub( .newBuilder() .setMethodDescriptor(listConnectionProfilesMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListConnectionProfilesRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings @@ -426,13 +421,10 @@ public Map extract(ListConnectionProfilesRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(getConnectionProfileMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetConnectionProfileRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings @@ -440,13 +432,10 @@ public Map extract(GetConnectionProfileRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(createConnectionProfileMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateConnectionProfileRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings @@ -454,15 +443,12 @@ public Map extract(CreateConnectionProfileRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(updateConnectionProfileMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(UpdateConnectionProfileRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put( - "connection_profile.name", - String.valueOf(request.getConnectionProfile().getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "connection_profile.name", + String.valueOf(request.getConnectionProfile().getName())); + return params.build(); }) .build(); GrpcCallSettings @@ -470,13 +456,10 @@ public Map extract(UpdateConnectionProfileRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteConnectionProfileMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteConnectionProfileRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings @@ -485,91 +468,70 @@ public Map extract(DeleteConnectionProfileRequest request) { .newBuilder() .setMethodDescriptor(discoverConnectionProfileMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DiscoverConnectionProfileRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings listStreamsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listStreamsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListStreamsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings getStreamTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getStreamMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetStreamRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings createStreamTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createStreamMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateStreamRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings updateStreamTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateStreamMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(UpdateStreamRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("stream.name", String.valueOf(request.getStream().getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("stream.name", String.valueOf(request.getStream().getName())); + return params.build(); }) .build(); GrpcCallSettings deleteStreamTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteStreamMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteStreamRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings fetchErrorsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(fetchErrorsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(FetchErrorsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("stream", String.valueOf(request.getStream())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("stream", String.valueOf(request.getStream())); + return params.build(); }) .build(); GrpcCallSettings @@ -577,13 +539,10 @@ public Map extract(FetchErrorsRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(fetchStaticIpsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(FetchStaticIpsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings @@ -591,13 +550,10 @@ public Map extract(FetchStaticIpsRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(createPrivateConnectionMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreatePrivateConnectionRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings @@ -605,13 +561,10 @@ public Map extract(CreatePrivateConnectionRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(getPrivateConnectionMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetPrivateConnectionRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings @@ -620,13 +573,10 @@ public Map extract(GetPrivateConnectionRequest request) { .newBuilder() .setMethodDescriptor(listPrivateConnectionsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListPrivateConnectionsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings @@ -634,65 +584,50 @@ public Map extract(ListPrivateConnectionsRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(deletePrivateConnectionMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeletePrivateConnectionRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings createRouteTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createRouteMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateRouteRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings getRouteTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getRouteMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetRouteRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); GrpcCallSettings listRoutesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listRoutesMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListRoutesRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); }) .build(); GrpcCallSettings deleteRouteTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteRouteMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteRouteRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); }) .build(); @@ -1084,7 +1019,13 @@ public UnaryCallable deleteRouteCallable() { @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 diff --git a/grpc-google-cloud-datastream-v1alpha1/pom.xml b/grpc-google-cloud-datastream-v1alpha1/pom.xml index 07d3beb7..a3804cdd 100644 --- a/grpc-google-cloud-datastream-v1alpha1/pom.xml +++ b/grpc-google-cloud-datastream-v1alpha1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-datastream-v1alpha1 - 0.1.0 + 0.2.0 grpc-google-cloud-datastream-v1alpha1 GRPC library for google-cloud-datastream com.google.cloud google-cloud-datastream-parent - 0.1.0 + 0.2.0 diff --git a/java.header b/java.header index 3a9b503a..d0970ba7 100644 --- a/java.header +++ b/java.header @@ -1,5 +1,5 @@ ^/\*$ -^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)$ ^ \*$ ^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ ^ \* you may not use this file except in compliance with the License\.$ diff --git a/pom.xml b/pom.xml index 540c5d39..0912fcd4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-datastream-parent pom - 0.1.0 + 0.2.0 Google Datastream Parent https://github.com/googleapis/java-datastream @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 0.12.0 + 1.0.0 @@ -69,23 +69,23 @@ com.google.cloud google-cloud-datastream - 0.1.0 + 0.2.0 com.google.api.grpc grpc-google-cloud-datastream-v1alpha1 - 0.1.0 + 0.2.0 com.google.api.grpc proto-google-cloud-datastream-v1alpha1 - 0.1.0 + 0.2.0 com.google.cloud google-cloud-shared-dependencies - 1.4.0 + 2.0.0 pom import diff --git a/proto-google-cloud-datastream-v1alpha1/pom.xml b/proto-google-cloud-datastream-v1alpha1/pom.xml index baae0829..a27687ab 100644 --- a/proto-google-cloud-datastream-v1alpha1/pom.xml +++ b/proto-google-cloud-datastream-v1alpha1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datastream-v1alpha1 - 0.1.0 + 0.2.0 proto-google-cloud-datastream-v1alpha1 Proto library for google-cloud-datastream com.google.cloud google-cloud-datastream-parent - 0.1.0 + 0.2.0 diff --git a/renovate.json b/renovate.json index e00486df..69a86ad8 100644 --- a/renovate.json +++ b/renovate.json @@ -69,5 +69,8 @@ } ], "semanticCommits": true, - "masterIssue": true + "dependencyDashboard": true, + "dependencyDashboardLabels": [ + "type: process" + ] } diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 379f808a..4d6c561b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-datastream - 0.0.0 + 0.1.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 47c22e9e..4f07424d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-datastream - 0.0.0 + 0.1.0 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index ae64096e..4c13ee5f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-datastream - 0.0.0 + 0.1.0 diff --git a/versions.txt b/versions.txt index 4aa28a31..35823428 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -google-cloud-datastream:0.1.0:0.1.0 -grpc-google-cloud-datastream-v1alpha1:0.1.0:0.1.0 -proto-google-cloud-datastream-v1alpha1:0.1.0:0.1.0 +google-cloud-datastream:0.2.0:0.2.0 +grpc-google-cloud-datastream-v1alpha1:0.2.0:0.2.0 +proto-google-cloud-datastream-v1alpha1:0.2.0:0.2.0