-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MessageConsumerImpl class, implement pullAsync, add tests #1043
Conversation
1652076
to
8eafca6
Compare
/cc @aozarov if you want to have a look |
Putting this on hold until changes discussed in #1041 are applied |
8eafca6
to
7693456
Compare
@aozarov I rebased to get latest changes to the spi layer. PTAL |
|
||
private static final int MAX_QUEUED_CALLBACKS = 100; | ||
// shared scheduled executor, used to schedule pulls | ||
private static final SharedResourceHolder.Resource<ScheduledExecutorService> TIMER = |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
28512a3
to
ff4c0a2
Compare
@aozarov I did some refactoring according to comments, PTAL |
this.deadlineRenewer = builder.deadlineRenewer; | ||
this.queuedCallbacks = new AtomicInteger(); | ||
this.timer = SharedResourceHolder.get(TIMER); | ||
this.executorFactory = firstNonNull(builder.executorFactory, new DefaultExecutorFactory()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
}; | ||
} | ||
|
||
private PullRequest createPullRequest() { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
/** | ||
* Interface for policies according to which the consumer should be restarted. | ||
*/ | ||
interface RestartPolicy { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Few minor comments. Overall looks good. |
Looks good to me. We need someone to look more carefully at the docs and tests. Maybe @lesv ? |
@lesv do you plan to have a look at this? |
Yes - if I'm not cc'd, I don't see it at the moment. Trying to fix it, but I'm still digging out from something in Q1. |
LGTM - 1. it seem like we should be able to do something like @SupressWarnings to Codacy |
Some of these warnings are false positives but in other cases they might still be helpful (I am thinking about the override warning here, I believe we could silent the one on raw exceptions).
Tests defined in |
We should at the very least have them in the repo, even if they don't execute regularly, they should be executed before push to maven. (Which should happen someday soon?) |
Why do the tests against production take that long? In any case, those should be integration test and not standard unit-tests. |
Unit tests by themselves take around 3 minutes to run. Adding integration tests makes tests take around 10 minutes. It's no surprise given the increased cost of created/getting/deleting resources against the actual service. Also, for
This does not change that on PR merges Travis will take around 40 minutes. I will add the IT tests and configure Travis with a larger timeout. |
Maybe it is about time to play with running the tests in parallel? |
…cies to v3.0.2 (#1043) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.1` -> `3.0.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/compatibility-slim/3.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/confidence-slim/3.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>googleapis/java-shared-dependencies</summary> ### [`v3.0.2`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​302-httpsgithubcomgoogleapisjava-shared-dependenciescomparev301v302-2022-09-08) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.1...v3.0.2) ##### Dependencies - Update dependency com.fasterxml.jackson:jackson-bom to v2.13.4 ([#​789](https://togithub.com/googleapis/java-shared-dependencies/issues/789)) ([6cf91a9](https://togithub.com/googleapis/java-shared-dependencies/commit/6cf91a96b9ea6af0fb845b50582dac7aa2892cab)) - Update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#​781](https://togithub.com/googleapis/java-shared-dependencies/issues/781)) ([8859e61](https://togithub.com/googleapis/java-shared-dependencies/commit/8859e61808bfc5cd9546e27e945fc855b36d2554)) - Update dependency com.google.auth:google-auth-library-bom to v1.11.0 ([#​790](https://togithub.com/googleapis/java-shared-dependencies/issues/790)) ([3431a47](https://togithub.com/googleapis/java-shared-dependencies/commit/3431a471cbf874a67a4f1a42e31f0ed891dedc92)) - Update dependency com.google.auth:google-auth-library-bom to v1.9.0 ([#​773](https://togithub.com/googleapis/java-shared-dependencies/issues/773)) ([27fc79f](https://togithub.com/googleapis/java-shared-dependencies/commit/27fc79f00ee70011df6a368bb8fcfad7f0ce41f0)) - Update dependency com.google.errorprone:error_prone_annotations to v2.15.0 ([#​776](https://togithub.com/googleapis/java-shared-dependencies/issues/776)) ([bf333b8](https://togithub.com/googleapis/java-shared-dependencies/commit/bf333b8c88072d21cb959db4d3328bbb55d9ef5c)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#​780](https://togithub.com/googleapis/java-shared-dependencies/issues/780)) ([da7f44d](https://togithub.com/googleapis/java-shared-dependencies/commit/da7f44d71d6d7f372b5313dab68ce220308614d4)) - Update dependency io.grpc:grpc-bom to v1.48.1 ([#​768](https://togithub.com/googleapis/java-shared-dependencies/issues/768)) ([5c7768d](https://togithub.com/googleapis/java-shared-dependencies/commit/5c7768d3c9665dd356de6c39c0a6a5fa6e992f2e)) - Update dependency io.grpc:grpc-bom to v1.49.0 ([#​786](https://togithub.com/googleapis/java-shared-dependencies/issues/786)) ([8734812](https://togithub.com/googleapis/java-shared-dependencies/commit/8734812f1b4e2faaa48caf41eff59a85892ae344)) - Update dependency org.checkerframework:checker-qual to v3.24.0 ([#​775](https://togithub.com/googleapis/java-shared-dependencies/issues/775)) ([df74b7b](https://togithub.com/googleapis/java-shared-dependencies/commit/df74b7b0dd5dd592523f302d9fb36adb5991cb0b)) - Update dependency org.checkerframework:checker-qual to v3.25.0 ([#​788](https://togithub.com/googleapis/java-shared-dependencies/issues/788)) ([207035b](https://togithub.com/googleapis/java-shared-dependencies/commit/207035bd04c9305899eea540acbefaf06a7b1ec9)) - Update dependency org.threeten:threetenbp to v1.6.1 ([#​782](https://togithub.com/googleapis/java-shared-dependencies/issues/782)) ([0f218ae](https://togithub.com/googleapis/java-shared-dependencies/commit/0f218aeb6aa33cf1da4a8b1d6c82bbf87946dab9)) - Update gax.version to v2.19.0 ([#​785](https://togithub.com/googleapis/java-shared-dependencies/issues/785)) ([4448331](https://togithub.com/googleapis/java-shared-dependencies/commit/4448331c4c6d88ea8076260776d1d47d24aa19fa)) - Update google.core.version to v2.8.10 ([#​787](https://togithub.com/googleapis/java-shared-dependencies/issues/787)) ([3c344d5](https://togithub.com/googleapis/java-shared-dependencies/commit/3c344d515e3b9215db5a1f8ef550d800d974e558)) - Update google.core.version to v2.8.7 ([#​774](https://togithub.com/googleapis/java-shared-dependencies/issues/774)) ([d0cd5e8](https://togithub.com/googleapis/java-shared-dependencies/commit/d0cd5e8f6ca88787fe0dbf7f30c849cb4c4fae5e)) - Update google.core.version to v2.8.8 ([#​777](https://togithub.com/googleapis/java-shared-dependencies/issues/777)) ([f00571c](https://togithub.com/googleapis/java-shared-dependencies/commit/f00571cd1e9f1c4e011fba4a1e1674c1d8d60200)) - Update google.core.version to v2.8.9 ([#​784](https://togithub.com/googleapis/java-shared-dependencies/issues/784)) ([aa8e505](https://togithub.com/googleapis/java-shared-dependencies/commit/aa8e505dbb1214b2239e55d5ac83b00c167d77e4)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-aiplatform). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xOTQuMiIsInVwZGF0ZWRJblZlciI6IjMyLjE5NC4yIn0=-->
🤖 I have created a release *beep* *boop* --- ## [3.3.0](googleapis/java-aiplatform@v3.2.0...v3.3.0) (2022-09-15) ### Features * add input_artifacts to PipelineJob.runtime_config in aiplatform v1 pipeline_job ([ff7a4ab](googleapis/java-aiplatform@ff7a4ab)) * Add model_monitoring_stats_anomalies,model_monitoring_status to BatchPredictionJob in aiplatform v1beta1 batch_prediction_job.proto ([#1041](googleapis/java-aiplatform#1041)) ([fe03c60](googleapis/java-aiplatform@fe03c60)) * Add read_mask to ListPipelineJobsRequest in aiplatform v1 pipeline_service ([#1032](googleapis/java-aiplatform#1032)) ([ff7a4ab](googleapis/java-aiplatform@ff7a4ab)) * Add UpsertDatapoints and RemoveDatapoints rpcs to IndexService in aiplatform v1 index_service.proto ([#1030](googleapis/java-aiplatform#1030)) ([4114021](googleapis/java-aiplatform@4114021)) * add UpsertDatapoints and RemoveDatapoints rpcs to IndexService in aiplatform v1beta1 index_service.proto ([4114021](googleapis/java-aiplatform@4114021)) * Add WriteFeatureValues in aiplatform v1beta1 featurestore_online_service.proto ([#1022](googleapis/java-aiplatform#1022)) ([267827e](googleapis/java-aiplatform@267827e)) ### Dependencies * Update dependency com.google.api.grpc:proto-google-cloud-aiplatform-v1beta1 to v0.18.0 ([#1021](googleapis/java-aiplatform#1021)) ([c3d34a0](googleapis/java-aiplatform@c3d34a0)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.14.5 ([#1016](googleapis/java-aiplatform#1016)) ([cc0af7b](googleapis/java-aiplatform@cc0af7b)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.14.6 ([#1026](googleapis/java-aiplatform#1026)) ([6ed66cc](googleapis/java-aiplatform@6ed66cc)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.14.7 ([#1031](googleapis/java-aiplatform#1031)) ([5adefd4](googleapis/java-aiplatform@5adefd4)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.15.0 ([#1040](googleapis/java-aiplatform#1040)) ([b6c1b20](googleapis/java-aiplatform@b6c1b20)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.16.0 ([#1044](googleapis/java-aiplatform#1044)) ([5ce52e5](googleapis/java-aiplatform@5ce52e5)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#1043](googleapis/java-aiplatform#1043)) ([40eae55](googleapis/java-aiplatform@40eae55)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#1045](googleapis/java-aiplatform#1045)) ([0f66302](googleapis/java-aiplatform@0f66302)) * Update dependency com.google.cloud:google-cloud-storage to v2.11.3 ([#1015](googleapis/java-aiplatform#1015)) ([7a2fcb0](googleapis/java-aiplatform@7a2fcb0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [2.2.13](https://togithub.com/googleapis/java-video-intelligence/compare/v2.2.12...v2.2.13) (2022-10-07) ### Dependencies * Update dependency com.google.cloud:google-cloud-core to v2.8.20 ([googleapis#1038](https://togithub.com/googleapis/java-video-intelligence/issues/1038)) ([51e1f2c](https://togithub.com/googleapis/java-video-intelligence/commit/51e1f2c6dc330f60f4b1c317ee8e10f029dfc108)) * Update dependency com.google.cloud:google-cloud-storage to v2.13.0 ([googleapis#1042](https://togithub.com/googleapis/java-video-intelligence/issues/1042)) ([a6cbae0](https://togithub.com/googleapis/java-video-intelligence/commit/a6cbae02b8831249a7f200679bdbb7ed738f55ce)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
This PR adds an implementation for the
MessageConsumer
interface and implements theMessageConsumer pullAsync(Subscription, MessageProcessor, PullOption...)
method. This PR also adds unit and system tests.A concern that I have about this PR is that the
PullOption.executor
option (used to provide a custom callback executor to the message consumer) cannot be made serializable. Can we live with that? Better solutions?